> > I like the look of std::format, looks cleaner than string streams
>
> I fully agree. String streams is a pain if you want to do zero-leading hex output mixed with decimal output. Yes it's easier to read if you don't know printf syntax,
> but 10-20 times more chars to write and not necessarily cleaner.
>
IMO c++ string streams formatting is optimized for "hello world" and is useless for printing hex numbers, table-formatted data and generally anything real-life.
plus the borked std::to_string() (it takes a global lock for the "C" locale), "fixed" it by introducing std::to_chars() in C++17,
with "ultimate fix" in std::format in C++26.
no question why C++ has the bad reputation. for a "done right" example, take a look at the Go standard library.
>
> Probable is that we would have to convert about a few thousand of sprintf's() in midas.
>
surprising few bare sprintf() remaining in MIDAS, most of them overflow-safe and most of them to be converted to msprintf().
K.O. |