From 5f30b8c26db9c9f7d9977016ea801c3ab3c221da Mon Sep 17 00:00:00 2001
From: Patrick Wuttke
Date: Fri, 27 Feb 2026 16:15:21 +0100
Subject: [PATCH] Added end() function to FormatBuffer to retrieve the end of
the stored string. Removed superfluous I template parameter from
formatTemp().
---
public/raid/imutil.hpp | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/public/raid/imutil.hpp b/public/raid/imutil.hpp
index 6ec5935..10bb744 100644
--- a/public/raid/imutil.hpp
+++ b/public/raid/imutil.hpp
@@ -20,9 +20,6 @@ namespace raid
namespace impl
{
-template
-inline std::string gFormatBuffer;
-
struct FormatBuffer
{
std::string data;
@@ -121,6 +118,13 @@ public:
MIJIN_ASSERT(mBufferIdx != kInvalidIdx, "invalid temp text");
return impl::gFormatBuffers[mBufferIdx].data.c_str();
}
+
+ [[nodiscard]]
+ const char* end() const noexcept
+ {
+ MIJIN_ASSERT(mBufferIdx != kInvalidIdx, "invalid temp text");
+ return impl::gFormatBuffers[mBufferIdx].data.c_str() + static_cast(impl::gFormatBuffers[mBufferIdx].data.size());
+ }
private:
void release()
{
@@ -218,7 +222,7 @@ const char* formatTemp(std::string& formatBuffer, std::format_string f
return formatBuffer.c_str();
}
-template
+template
[[nodiscard]]
TempText formatTemp(std::format_string fmt, TArgs&&... args)
{