Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

status of C++23 formatting ranges

Tags:

c++

c++23

I watched Barry Revzin's talk on Formatting Ranges that was very interesting. I see the feature status page that Formatting Ranges is still planned for C++23, ad it says clang has implemented it.

But when I try some of Barry's examples on godbolt(with -std=c++2b), I get compiler errors, and today getting core dumps.

Plus when Googling around, I don't see many talking about it. I don't even see much on cppreference?

Understandably the release isn't complete, but seems odd that documentation is lacking, and nobody is taking about it?

  • not much chatter about it
  • Godbolt isn't compiling
  • not much documentation on CppReference
like image 849
W Murphy Avatar asked Sep 16 '25 21:09

W Murphy


1 Answers

Range formatting is a part of C++23 and documented at cppreference.

Your pair example is incorrect since pairs don't support format specifications for their elements which is why it won't compile even with libc++ that claims to implement range formatting. libstdc++ and Microsoft STL don't (fully) support range formatting yet.

like image 126
vitaut Avatar answered Sep 19 '25 11:09

vitaut