News for hackers. Stuff that matters.
Re:Orthodox C++ by o11c on Wednesday May 22, 2024 @06:45PM (#40447692)
The hardest part of passing `std::string` to `printf` was getting the macro to convince the pre-standard-C++11 compiler that it was `constexpr` enough so that `-Werror=format` would work.

I found it was easiest to sometimes allocate a temporary, if the input wasn't known to be NUL-terminated.

There are no comments on this comment yet.