I just tried to print std::this_thread::get_id() using {}. This doesn't compile. The error message under either c++ or llvm is not great (just refers to "type T").
class thread::id but not auto or a lambda function.In particular class thread::id has a << method already -- should format fall back on that until the opposite is true?
FWIW no special constraints on thread::ids can be assumed except they must function as container keys. They my not be integers or pointers.
I'd try to make a pull request but I'm not even sure what ought to happen here except that {} should work with thread ids.
#include <fmt/ostream.h>
As @agmt commented, {fmt} supports formatting of types with ostream operator<< via fmt/ostream.h: https://fmt.dev/latest/api.html#ostream-api
Thanks to you both and my apologies for missing that in the documentation.
Most helpful comment
#include <fmt/ostream.h>