I'm not sure but since you can customize the format for your own types I suspect spaces and other whitespace characters might make a difference so it's probably better to be strict to avoid any surprises later.
I was really talking about the diagnostic messages. I had forgotten support is lacking.
If the aim to eventually replace cout with a std::format variant (std::print?) it would be nice for the compiler to give less opaque error messages, as a special case.
In other words I want something analogous to -Wformat - something that gives better diagnostics when the format string is screwed up.
From the start with C++20 and VS -- VS 2019 FYI, VS 2022 hadn't been released yet in wide distribution -- I found the error messages with std::format to be less than clear, they were decidedly un-helpful.
That was when std::format bugged out at run-time, before the C++ stdlib changed the behavior to be compile-time. Learning the byways and peculiarities of C++20 is intimidating enough even with plain language errors.
I don't believe getting clear and understandable error messaging should be a compile flag, on or off. But what do I know.
I ain't one of the compiler implementation team members, so maybe it is harder than it might seem to be.
VS Intellisense quite a lot goes buggy with modules, reporting things are wrong when doing a compile everything is hunky-dory.
As GCC and Clang have had issues providing std::to_chars/from_chars with floating point and std::format uses these, is this a reason why GCC and Clang haven't yet released std::format?
I assume clang, gnu and msft will take from you that header on some date? Or they will just go ahead and implement it and then ask you to approve? And what about compiler vendors? Is WG21 coordinating any of this?
I know that is possible to do. But. Is it not to be expected Victor's implementation is of the best quality? Tried and tested and such ... None of "them three teams" writes "bugless code", so why not just cooperating here on the reference implementation?
foonathan wrote:
An issue with fmt is that it has a lot of workarounds for various older compilers and weird OSes. A standard library implementation of a C++20 feature probably has fewer compatibility issues to worry about. They also need to _Uglify the implementation, so they can't directly copy it anyway.
I have no idea if anyone is working on it but at least it has been reported as a bug.
That's interesting. The std::format bug no. is 104166. This has a dependency on bug 88322 being fixed - but bug 88322 has a dependency on bug 104166 being fixed...