diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
commit | 332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 (patch) | |
tree | fd9c441b796b522bdd5c7f8fbd32f51b8eff2a28 /source/core/StarStaticVector.hpp | |
parent | 14b9689b6d4f4ad5276c88130dc6e449bedc0709 (diff) |
The Formatting String Catastrophe
Diffstat (limited to 'source/core/StarStaticVector.hpp')
-rw-r--r-- | source/core/StarStaticVector.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/core/StarStaticVector.hpp b/source/core/StarStaticVector.hpp index 693dc10..3a4a7cc 100644 --- a/source/core/StarStaticVector.hpp +++ b/source/core/StarStaticVector.hpp @@ -188,7 +188,7 @@ bool StaticVector<Element, MaxSize>::empty() const { template <typename Element, size_t MaxSize> void StaticVector<Element, MaxSize>::resize(size_t size, Element const& e) { if (size > MaxSize) - throw StaticVectorSizeException::format("StaticVector::resize(%s) out of range %s", m_size + size, MaxSize); + throw StaticVectorSizeException::format("StaticVector::resize({}) out of range {}", m_size + size, MaxSize); for (size_t i = m_size; i > size; --i) pop_back(); @@ -199,14 +199,14 @@ void StaticVector<Element, MaxSize>::resize(size_t size, Element const& e) { template <typename Element, size_t MaxSize> auto StaticVector<Element, MaxSize>::at(size_t i) -> reference { if (i >= m_size) - throw OutOfRangeException::format("out of range in StaticVector::at(%s)", i); + throw OutOfRangeException::format("out of range in StaticVector::at({})", i); return ptr()[i]; } template <typename Element, size_t MaxSize> auto StaticVector<Element, MaxSize>::at(size_t i) const -> const_reference { if (i >= m_size) - throw OutOfRangeException::format("out of range in StaticVector::at(%s)", i); + throw OutOfRangeException::format("out of range in StaticVector::at({})", i); return ptr()[i]; } @@ -329,7 +329,7 @@ template <typename Element, size_t MaxSize> template <typename... Args> void StaticVector<Element, MaxSize>::emplace_back(Args&&... args) { if (m_size + 1 > MaxSize) - throw StaticVectorSizeException::format("StaticVector::emplace_back would extend StaticVector beyond size %s", MaxSize); + throw StaticVectorSizeException::format("StaticVector::emplace_back would extend StaticVector beyond size {}", MaxSize); m_size += 1; new (ptr() + m_size - 1) Element(forward<Args>(args)...); |