> This is the sort of change that adds complexity to the language but reduces complexity in the code written in the language. We take those
An admirable statement of policy, but I'm not sure it's possible. Adding complexity to the language means there are more gotchas and edge-cases that a programmer must consider, even if they don't use the feature in question.
how would this work with internationalized strings? especially if you have to change the order of things? You'd still need a string version with object ordering I would think
C++ also has std::format, which was introduced in C++20. This is just sugar on top of it, except it also returns a container type so that printing functions can have overloads that format into a file or stream directly from an f-string, instead of going through the overhead of a temporary string.
I'm wonder what this mysterious application is that is doing heavy formatting of strings but can't afford the overhead of a temporary string, and therefore requires horrifying and inscrutable and dangerous language extensions.
mkoubaa|1 year ago
hackyhacky|1 year ago
An admirable statement of policy, but I'm not sure it's possible. Adding complexity to the language means there are more gotchas and edge-cases that a programmer must consider, even if they don't use the feature in question.
puffybuf|1 year ago
HeliumHydride|1 year ago
rerdavies|1 year ago
richrichardsson|1 year ago
fmt library can also do something similar, but still requires the complexity of adding the library and passing arguments.
hyperpl|1 year ago
nikhilsimha|1 year ago