std::format

Halleluja, Halleluja, Halleluja

All major compilers now support std::format (GCC v13, Clang v15, VS 2022 17.2) including the DR's.

So now no excuse not to now use std::format and std::format_to
Well, hot diggity dang! Finally!

Now they need to do modules. Partial support ain't cuttin' it.

I see a "lot" of long-time programmers who will insist using std::format is not worth the effort, while continuing to use C formatting functions.

Personally I am very fond of std::format, it is a near complete replacement for the C functions.

But, hey, I am a self-taught programming hobbyist, not a professional. So what do I know.
If someone is using c formatting functions then it's almost trivial to move to std::format/std::format_to. No excuses excepted! Much easier than moving from the stream formatting ways...
@seeplus, you are preaching to the choir, ya know. :)

But some old-time programmers will insist the old ways are still the best and only way to go. No new-fangled C++ bloaty (in their opinion!) code accepted!

Now that C++23 is is the newest standard I am ginormously amused that MS Visual Studio is still the only major compiler 100% compliant with the C++20 standard. Every other one is either partial or no support on key provisions. Modules being a big example.

Before C++20 MS used to be the laggard with their compilers/IDEs being compliant to the then current standard.

So far MS is trailing with C++23 core language compliance as well, marginally ahead in C++23 library feature compliance. Not a single major compiler is 100%, though the others are ahead of shoe-horning that support in.

https://en.cppreference.com/w/cpp/compiler_support/23
out of curiosity, is there a 'major' compiler that isnt GCC or MSVC? I don't count rebranding of GCC in that -- I know a few things repackage it under a new label.
Last edited on
is there a 'major' compiler that isnt GCC or MSVC?

Clang?
@jonnin I bet some would count Clang as 'major'.
At cpprefeerence the first three compilers listed on the support pages are, left to right:

GCC, Clang and MSVC.

https://en.cppreference.com/w/cpp/compiler_support/20

Quite a number of lesser known/used compilers on the list as well.

I don't know Clang, have it installed but never used it, yet I certainly would consider it one of the major compilers.

I think Embarcadero C++ Builder is based around Clang...
Last edited on
Yes, Clang is important. I hadn't studied it or used it much and thought it was g++ derived, so I left it out. Closer look says it just mimics g++ command line while being its own thing.
Speaking of std::format.....

MS released a new version of Visual Studio 2022, 17.5. One of the fixes/updates implemented several stdlib features, including a handful of basic_format_string updates/revisions.

https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-notes#17.5.0

Nice hefty download, 2.16 GB for me.
Well perhaps more important than clang, is the LLVM toolset, a lot of really good things in there.

https://llvm.org/
Last edited on
Topic archived. No new replies allowed.