Compare commits
No commits in common. "b8f59710d37307443dfab488c8daa7060cc51252" and "74c4a4d5825d4efd49672715df8d72ea60ef5b4b" have entirely different histories.
b8f59710d3
...
74c4a4d582
@ -11,7 +11,8 @@ During compile-time, the string to be formatted is preprocessed to the point onl
|
|||||||
have to be written (If they are not available at compile time).
|
have to be written (If they are not available at compile time).
|
||||||
|
|
||||||
For example `One number: {:03}; And another one: {:05.3}` is preprocessed into `One number: 000; And another one: 00.000`.
|
For example `One number: {:03}; And another one: {:05.3}` is preprocessed into `One number: 000; And another one: 00.000`.
|
||||||
This is returned as a `std::array<char, N>`, where `N` is automatically evaluated. The only code executed at runtime then formats the numbers and writes them into their places in the array.
|
This is returned as a `std::array<char, N>`, where `N` is automatically evaluated. The only code executed at compile
|
||||||
|
time then formats the numbers and writes them into their place in the array.
|
||||||
|
|
||||||
Disclaimer: The actual formatting code is largely shamelessly stolen from `fmtlib`.
|
Disclaimer: The actual formatting code is largely shamelessly stolen from `fmtlib`.
|
||||||
|
|
||||||
@ -47,11 +48,8 @@ $ ctest --test-dir build/
|
|||||||
|
|
||||||
## Limitations
|
## Limitations
|
||||||
|
|
||||||
For the compile time preprocessing of format strings non non-type template parameters are heavily relied upon,
|
|
||||||
which means C++20 is required.
|
|
||||||
|
|
||||||
Only a relatively limited subset of the `fmtlib` syntax is recognized (for now anyway). In particular,
|
Only a relatively limited subset of the `fmtlib` syntax is recognized (for now anyway). In particular,
|
||||||
float formatting in decimal and integer formatting in decimal, binary and hexadecimal are supported.
|
there is no support for positional arguments, alignment, chrono format specs and custom const_format specifications.
|
||||||
|
|
||||||
By nature of the library design, which forces compile-time preprocessing of the const_format string, no dynamic width or
|
By nature of the library design, which forces compile-time preprocessing of the const_format string, no dynamic width or
|
||||||
dynamic precision can be implemented.
|
dynamic precision can be implemented.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user