etl
etl copied to clipboard
Feature request: getting string format in C++ 20 style?
C++ 20 received new ways to format strings, in a python-like way (https://en.cppreference.com/w/cpp/utility/format/format), for example:
std::format("{} {}!", "Hello", "world", "something"); // OK, produces "Hello world!"
This looks amazing, as this is both safe, simple to read and write, and starts to be nearly a "de facto standard" across languages (I finally do not need to get confused when switching back and forth between python and c++, hooray!).
I think that the etl provides something quite similar thanks to the to_string API (https://www.etlcpp.com/to_string.html). However, would it be possible to get something that is fully similar / compliant to the C++ 20 std::format? That would make it even easier to use, would reduce brain overhead switching between etl and "standard" C++ 20.
I'll certainly put it on my ToDo list (which is a bit long at the moment!)
That sounds amazing :) No worries no hurries, and many thanks :) .
It's possible to use fmtlib directly with the specific set of definitions for reducing the binary size of the library.
https://github.com/fmtlib/fmt seems to be great and well tested but use "heavily" the std library.
It may be possible to fork the library and modify it (where possible) to use the ETL, and include it in the ETL.
I looked at the code and the use of the STL is very extensive. I don't think a modification of the code would be very simple or easy.