Skip to content

Commit

Permalink
Mention namespace fmt::literals in the document (#4002)
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 authored Jun 8, 2024
1 parent 0f6e716 commit fe741da
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,12 +533,13 @@ feature](https://en.cppreference.com/w/cpp/feature_test).
## Format String Compilation
`fmt/compile.h` provides format string compilation enabled via the
`FMT_COMPILE` macro or the `_cf` user-defined literal. Format strings
marked with `FMT_COMPILE` or `_cf` are parsed, checked and converted
into efficient formatting code at compile-time. This supports arguments
of built-in and string types as well as user-defined types with `format`
functions taking the format context type as a template parameter in
their `formatter` specializations. For example:
`FMT_COMPILE` macro or the `_cf` user-defined literal (defined in
namespace `fmt::literals`). Format strings marked with `FMT_COMPILE`
or `_cf` are parsed, checked and converted into efficient formatting
code at compile-time. This supports arguments of built-in and string
types as well as user-defined types with `format` functions taking
the format context type as a template parameter in their `formatter`
specializations. For example:
template <> struct fmt::formatter<point> {
constexpr auto parse(format_parse_context& ctx);
Expand Down

0 comments on commit fe741da

Please sign in to comment.