|
fmt
|
Functions | |
| template<detail::FixedString Str> | |
| constexpr auto | operator""_cf () -> CompiledFormatString< Str > |
| template<detail::FixedString S> | |
| constexpr auto | operator""_a () |
Converts a string literal into a compiled format string.
The format string is parsed at compile time and turned into formatting code, so no run-time format string processing remains. This is faster than an ordinary format string at the cost of code size, and it requires a literal.
Example:
using namespace fmt::literals;
// No run-time format string processing.
std::string s = fmt::format("{}"_cf, 42);
|
constexprexport |
User-defined literal equivalent of fmt::arg, but with compile-time checks.
Example:
using namespace fmt::literals;
fmt::print("The answer is {answer}.", "answer"_a=42);