From 332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 27 Jun 2023 20:23:44 +1000 Subject: The Formatting String Catastrophe --- source/core/StarStaticVector.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/core/StarStaticVector.hpp') 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::empty() const { template void StaticVector::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::resize(size_t size, Element const& e) { template auto StaticVector::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 auto StaticVector::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 template void StaticVector::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)...); -- cgit v1.2.3