MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/duyjs7/i_made_cstyle_printing_in_python_p/f7bd57q/?context=9999
r/Python • u/[deleted] • Nov 11 '19
130 comments sorted by
View all comments
66
I’d prefer it the other way round - f-strings in C++ :)
16 u/[deleted] Nov 11 '19 https://en.cppreference.com/w/cpp/utility/format 18 u/Xirious Nov 12 '19 That's like old style .format and not f-strings. 3 u/germandiago Nov 12 '19 f-strings require some kind of reflection, which C++ unfortunately does not support yet. 1 u/[deleted] Nov 12 '19 edited Nov 12 '19 I believe that some magic with macros and VARGS could do the job :P The trick is to use not used character as quotation mark.Just like in JavaScript. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
16
https://en.cppreference.com/w/cpp/utility/format
18 u/Xirious Nov 12 '19 That's like old style .format and not f-strings. 3 u/germandiago Nov 12 '19 f-strings require some kind of reflection, which C++ unfortunately does not support yet. 1 u/[deleted] Nov 12 '19 edited Nov 12 '19 I believe that some magic with macros and VARGS could do the job :P The trick is to use not used character as quotation mark.Just like in JavaScript. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
18
That's like old style .format and not f-strings.
3 u/germandiago Nov 12 '19 f-strings require some kind of reflection, which C++ unfortunately does not support yet. 1 u/[deleted] Nov 12 '19 edited Nov 12 '19 I believe that some magic with macros and VARGS could do the job :P The trick is to use not used character as quotation mark.Just like in JavaScript. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
3
f-strings require some kind of reflection, which C++ unfortunately does not support yet.
1 u/[deleted] Nov 12 '19 edited Nov 12 '19 I believe that some magic with macros and VARGS could do the job :P The trick is to use not used character as quotation mark.Just like in JavaScript. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
1
I believe that some magic with macros and VARGS could do the job :P The trick is to use not used character as quotation mark.
Just like in JavaScript. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
66
u/fatbob42 Nov 11 '19
I’d prefer it the other way round - f-strings in C++ :)