Builders use a std::ostreamstring internally to store the message. Builder::message() overwrites this, but surprisingly doesn't update the position to the end of the stream by default, so future Builder::add_message() calls overwrite the base message.
Builders use a
std::ostreamstring
internally to store the message.Builder::message()
overwrites this, but surprisingly doesn't update the position to the end of the stream by default, so futureBuilder::add_message()
calls overwrite the base message.This is "the design" of
std::ostreamstring
and can be fixed with a constructor argument: https://stackoverflow.com/questions/62238203/stdostringstream-overwriting-initializing-string