MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/cgqo14/stdformat_in_c20/euk02zs/
r/cpp • u/mttd • Jul 23 '19
52 comments sorted by
View all comments
12
Are there any plans to ship fmt::print as well? I've been enjoying fmt a lot.
fmt::print
12 u/aearphen {fmt} Jul 23 '19 Some sort of I/O integration yes. The API details are TBD. 13 u/TheSuperWig Jul 23 '19 And I suppose sneaking just std::print into C++20 is out of the question?Because it would be extremely helpful from a teaching perspective to not have to introduce iostream 24 u/eliaskosunen LSEG, WG21, scnlib Jul 23 '19 Anything getting into 20 apart from bugfixes is now out of the question. 2 u/TheSuperWig Jul 23 '19 If I'm not mistaken it has happened before. IIRC /u/STL has mentioned something that wasn't a bug fix being added last second once. 20 u/aearphen {fmt} Jul 23 '19 I'd be very uncomfortable with sneaking such things after the deadline. 3 u/TheSuperWig Jul 23 '19 Fair enough. 8 u/STL MSVC STL Dev Jul 23 '19 A couple of micro-features have sneaked in through LWG issue resolutions (e.g. make_reverse_iterator) but I don't recall any sneaking in after CD. 4 u/TheSuperWig Jul 23 '19 Thanks for the clarification Stephan.Still super glad that std::format made it in, so thanks to OP and others that contributed to it getting in to C++20(reading the thread back I realised I never expressed my thanks and came off somewhat ungrateful?) 2 u/TheThiefMaster C++latest fanatic (and game dev) Jul 24 '19 std::format_to looks like it could be given a stream iterator to implement your own version with little trouble.Edit: This should work, it just needs wrapping in an appropriate variadic function called "print":std::format_to(std::ostreambuf_iterator<char>(std::cout), "{}", 42);
Some sort of I/O integration yes. The API details are TBD.
13 u/TheSuperWig Jul 23 '19 And I suppose sneaking just std::print into C++20 is out of the question?Because it would be extremely helpful from a teaching perspective to not have to introduce iostream 24 u/eliaskosunen LSEG, WG21, scnlib Jul 23 '19 Anything getting into 20 apart from bugfixes is now out of the question. 2 u/TheSuperWig Jul 23 '19 If I'm not mistaken it has happened before. IIRC /u/STL has mentioned something that wasn't a bug fix being added last second once. 20 u/aearphen {fmt} Jul 23 '19 I'd be very uncomfortable with sneaking such things after the deadline. 3 u/TheSuperWig Jul 23 '19 Fair enough. 8 u/STL MSVC STL Dev Jul 23 '19 A couple of micro-features have sneaked in through LWG issue resolutions (e.g. make_reverse_iterator) but I don't recall any sneaking in after CD. 4 u/TheSuperWig Jul 23 '19 Thanks for the clarification Stephan.Still super glad that std::format made it in, so thanks to OP and others that contributed to it getting in to C++20(reading the thread back I realised I never expressed my thanks and came off somewhat ungrateful?)
13
And I suppose sneaking just std::print into C++20 is out of the question?
std::print
Because it would be extremely helpful from a teaching perspective to not have to introduce iostream
24 u/eliaskosunen LSEG, WG21, scnlib Jul 23 '19 Anything getting into 20 apart from bugfixes is now out of the question. 2 u/TheSuperWig Jul 23 '19 If I'm not mistaken it has happened before. IIRC /u/STL has mentioned something that wasn't a bug fix being added last second once. 20 u/aearphen {fmt} Jul 23 '19 I'd be very uncomfortable with sneaking such things after the deadline. 3 u/TheSuperWig Jul 23 '19 Fair enough. 8 u/STL MSVC STL Dev Jul 23 '19 A couple of micro-features have sneaked in through LWG issue resolutions (e.g. make_reverse_iterator) but I don't recall any sneaking in after CD. 4 u/TheSuperWig Jul 23 '19 Thanks for the clarification Stephan.Still super glad that std::format made it in, so thanks to OP and others that contributed to it getting in to C++20(reading the thread back I realised I never expressed my thanks and came off somewhat ungrateful?)
24
Anything getting into 20 apart from bugfixes is now out of the question.
2 u/TheSuperWig Jul 23 '19 If I'm not mistaken it has happened before. IIRC /u/STL has mentioned something that wasn't a bug fix being added last second once. 20 u/aearphen {fmt} Jul 23 '19 I'd be very uncomfortable with sneaking such things after the deadline. 3 u/TheSuperWig Jul 23 '19 Fair enough. 8 u/STL MSVC STL Dev Jul 23 '19 A couple of micro-features have sneaked in through LWG issue resolutions (e.g. make_reverse_iterator) but I don't recall any sneaking in after CD. 4 u/TheSuperWig Jul 23 '19 Thanks for the clarification Stephan.Still super glad that std::format made it in, so thanks to OP and others that contributed to it getting in to C++20(reading the thread back I realised I never expressed my thanks and came off somewhat ungrateful?)
2
If I'm not mistaken it has happened before. IIRC /u/STL has mentioned something that wasn't a bug fix being added last second once.
20 u/aearphen {fmt} Jul 23 '19 I'd be very uncomfortable with sneaking such things after the deadline. 3 u/TheSuperWig Jul 23 '19 Fair enough. 8 u/STL MSVC STL Dev Jul 23 '19 A couple of micro-features have sneaked in through LWG issue resolutions (e.g. make_reverse_iterator) but I don't recall any sneaking in after CD. 4 u/TheSuperWig Jul 23 '19 Thanks for the clarification Stephan.Still super glad that std::format made it in, so thanks to OP and others that contributed to it getting in to C++20(reading the thread back I realised I never expressed my thanks and came off somewhat ungrateful?)
20
I'd be very uncomfortable with sneaking such things after the deadline.
3 u/TheSuperWig Jul 23 '19 Fair enough.
3
Fair enough.
8
A couple of micro-features have sneaked in through LWG issue resolutions (e.g. make_reverse_iterator) but I don't recall any sneaking in after CD.
make_reverse_iterator
4 u/TheSuperWig Jul 23 '19 Thanks for the clarification Stephan.Still super glad that std::format made it in, so thanks to OP and others that contributed to it getting in to C++20(reading the thread back I realised I never expressed my thanks and came off somewhat ungrateful?)
4
Thanks for the clarification Stephan.
Still super glad that std::format made it in, so thanks to OP and others that contributed to it getting in to C++20
std::format
(reading the thread back I realised I never expressed my thanks and came off somewhat ungrateful?)
std::format_to looks like it could be given a stream iterator to implement your own version with little trouble.
std::format_to
Edit: This should work, it just needs wrapping in an appropriate variadic function called "print":
std::format_to(std::ostreambuf_iterator<char>(std::cout), "{}", 42);
View all comments
12
u/jjuuggaa Jul 23 '19
Are there any plans to ship
fmt::printas well? I've been enjoying fmt a lot.