Added end() function to FormatBuffer to retrieve the end of the stored string. Removed superfluous I template parameter from formatTemp().
This commit is contained in:
@@ -20,9 +20,6 @@ namespace raid
|
||||
|
||||
namespace impl
|
||||
{
|
||||
template<std::size_t I>
|
||||
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<std::ptrdiff_t>(impl::gFormatBuffers[mBufferIdx].data.size());
|
||||
}
|
||||
private:
|
||||
void release()
|
||||
{
|
||||
@@ -218,7 +222,7 @@ const char* formatTemp(std::string& formatBuffer, std::format_string<TArgs...> f
|
||||
return formatBuffer.c_str();
|
||||
}
|
||||
|
||||
template<std::size_t I = 0, typename... TArgs>
|
||||
template<typename... TArgs>
|
||||
[[nodiscard]]
|
||||
TempText formatTemp(std::format_string<TArgs...> fmt, TArgs&&... args)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user