Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/core/StarMap.hpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-27 20:23:44 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-27 20:23:44 +1000
commit332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 (patch)
treefd9c441b796b522bdd5c7f8fbd32f51b8eff2a28 /source/core/StarMap.hpp
parent14b9689b6d4f4ad5276c88130dc6e449bedc0709 (diff)
The Formatting String Catastrophe
Diffstat (limited to 'source/core/StarMap.hpp')
-rw-r--r--source/core/StarMap.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/core/StarMap.hpp b/source/core/StarMap.hpp
index e4941f3..cf9c260 100644
--- a/source/core/StarMap.hpp
+++ b/source/core/StarMap.hpp
@@ -163,7 +163,7 @@ template <typename BaseMap>
auto MapMixin<BaseMap>::take(key_type const& k) -> mapped_type {
if (auto v = maybeTake(k))
return v.take();
- throw MapException(strf("Key '%s' not found in Map::take()", outputAny(k)));
+ throw MapException(strf("Key '{}' not found in Map::take()", outputAny(k)));
}
template <typename BaseMap>
@@ -182,7 +182,7 @@ template <typename BaseMap>
auto MapMixin<BaseMap>::get(key_type const& k) -> mapped_type& {
iterator i = Base::find(k);
if (i == Base::end())
- throw MapException(strf("Key '%s' not found in Map::get()", outputAny(k)));
+ throw MapException(strf("Key '{}' not found in Map::get()", outputAny(k)));
return i->second;
}
@@ -190,7 +190,7 @@ template <typename BaseMap>
auto MapMixin<BaseMap>::get(key_type const& k) const -> mapped_type const& {
const_iterator i = Base::find(k);
if (i == Base::end())
- throw MapException(strf("Key '%s' not found in Map::get()", outputAny(k)));
+ throw MapException(strf("Key '{}' not found in Map::get()", outputAny(k)));
return i->second;
}
@@ -236,7 +236,7 @@ auto MapMixin<BaseMap>::keyOf(mapped_type const& v) const -> key_type {
if (i->second == v)
return i->first;
}
- throw MapException(strf("Value '%s' not found in Map::keyOf()", outputAny(v)));
+ throw MapException(strf("Value '{}' not found in Map::keyOf()", outputAny(v)));
}
template <typename BaseMap>
@@ -267,7 +267,7 @@ template <typename BaseMap>
auto MapMixin<BaseMap>::add(key_type k, mapped_type v) -> mapped_type& {
auto pair = Base::insert(value_type(move(k), move(v)));
if (!pair.second)
- throw MapException(strf("Entry with key '%s' already present.", outputAny(k)));
+ throw MapException(strf("Entry with key '{}' already present.", outputAny(k)));
else
return pair.first->second;
}