Remix.run Logo
kevin_thibedeau a day ago

  char buffer[64];
  String_Buffer buf = {str, sizeof str};
Probably meant the "buffer" to be "str" here.
thw_9a83c a day ago | parent [-]

Clearly yes. BTW, I don't see a benefit to use a non-owning String_Buffer over std::string (or std::string_view) in this context.

kevin_thibedeau a day ago | parent [-]

The subtext is a resource constrained system where std::format is considered too heavyweight. In that scenario, explicit non-automatic memory management is a benefit. It could still leverage std::string_view and be agnostic on the topic.