3 ms·
char buffer[64]; String_Buffer buf = {str, sizeof str}; Probably meant the "buffer" to be "str" here.
by kevin_thibedeau 1y ago
char buffer[64];
String_Buffer buf = {str, sizeof str};
Probably meant the "buffer" to be "str" here.
- thw_9a83c 1y agoClearly 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 1y agoThe 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.