Should enums be formattable by default?
@vitaut maybe something like string(int) ?
@vitaut Everything should be formattable by default for printf-debugging, some things should also have a general string representation.
Rust solves this elegantly with Debug vs Display traits.
@foonathan by some definition of elegantly
@vitaut What do you not like about it?
@foonathan format language is very limited compared to python
fwiw, for my C++26 version of my unit testing framework, i implemented generic output (to_string) for types not supported by format. unfortunately cannot do it directly as formatter (may be just my fault)
https://github.com/PeterSommerlad/CUTE/blob/master/ws_cute/crut/src/crutmodule.cpp
@vitaut you mean, in C++? I think that at first it should be vendor-specific, then they should introduce compiler options and/or pragms to choose the desired behavior, then the C++ committee should standardize it in a way that would make it easy for compiler vendors to make mistakes, and Microsoft should have a memory leak in their implementation, and then the C++ programmers should make a new "good practice" to equip their programs with a mechanism that checks whether it has been leaked, and they should use it for 20 years after Microsoft had fixed their bug, until Herb Sutter writes a blog post that it is OK not to check for memory leaks over that feature any more
@PaniczGodek This is the correct answer.
@vitaut if strings, what would be the string for values without enumerators?
@JSAMcFarlane right now we print the numeric value in those cases