You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use fmt::basic_fixed_buffer<CharT> in combination with fmt::writer to format content in a fixed-size buffer.
However, I would like to keep formatting until I reach the capacity of the buffer and be notified when it happens. Currently, I'm relying on the fact that basic_fixed_buffer::grow() throws a std::runtime_error to know whether my buffer is full or not but I think it's not ideal.
I propose non-throwing version of grow() and write functions. For example, I'd like to write:
char buffer[MAX_BODY_SIZE];
fmt::basic_fixed_buffer<char> buf(buffer);
fmt::writer writer(buf);
if (!writer.try_write(sequence_number))
{
// Do something
}
Thanks.
The text was updated successfully, but these errors were encountered:
I would like to use
fmt::basic_fixed_buffer<CharT>
in combination withfmt::writer
to format content in a fixed-size buffer.However, I would like to keep formatting until I reach the capacity of the buffer and be notified when it happens. Currently, I'm relying on the fact that
basic_fixed_buffer::grow()
throws astd::runtime_error
to know whether my buffer is full or not but I think it's not ideal.I propose non-throwing version of
grow()
andwrite
functions. For example, I'd like to write:Thanks.
The text was updated successfully, but these errors were encountered: