Reference

Namespaces

Name
fmt

fmt namespace

Namespaces

Name
enums
safe_duration_cast

Types

Name Description
basic_appender
basic_cstring_view A reference to a null-terminated string. It can be constructed from a C string or std::string.
basic_format_arg
basic_format_args A view of a collection of formatting arguments. To avoid lifetime issues it should only be used as a parameter type in type-erased functions such as vformat:
basic_fstring
basic_memory_buffer A dynamically growing memory buffer for trivially copyable/constructible types with the first SIZE elements stored in the object itself. Most commonly used via the memory_buffer alias for char.
basic_ostream_formatter
basic_printf_context
basic_specs
basic_string_view An implementation of std::basic_string_view for pre-C++17. It provides a subset of the API. fmt::basic_string_view is used for format strings even if std::basic_string_view is available to prevent issues when a library is compiled with a different -std option than the client code (which is not recommended).
buffered_file
bytes
compiled_string
conjunction
conjunction<P>
conjunction<P1, Pn...>
context
day
dynamic_format_arg_store A dynamic list of formatting arguments with storage.
file
format_error An error reported from a formatting function.
format_facet
format_facet<locale>
format_int A fast integer formatter.
format_specs
format_to_n_result
format_to_result
formatter
formatter</* implementation-defined */>
formatter<bytes>
formatter<std::error_code>
formatter<std::source_location>
formatter<group_digits_view<T>>
formatter<std::atomic_flag, Char>
formatter<std::byte, Char>
formatter<day, Char>
formatter</* implementation-defined */, Char>
formatter<std::thread::id, Char>
formatter<std::monostate, Char>
formatter<month, Char>
formatter<std::nullptr_t, Char>
formatter<std::filesystem::path, Char>
formatter<tm, Char>
formatter<std::type_info, Char>
formatter<weekday, Char>
formatter<year, Char>
formatter<year_month_day, Char>
formatter</* implementation-defined */, Char>
formatter<signed char, Char>
formatter<unsigned char, Char>
formatter<short, Char>
formatter<unsigned short, Char>
formatter<long, Char>
formatter<unsigned long, Char>
formatter<Char*, Char>
formatter<void*, Char>
formatter<BitRef, Char>
formatter<R, Char>
formatter<R, Char>
formatter<R, Char>
formatter<T, Char>
formatter<T, Char>
formatter<T, Char>
formatter<Tuple, Char>
formatter<Variant, Char>
formatter<std::atomic<T>, Char>
formatter<std::bitset<N>, Char>
formatter<std::complex<T>, Char>
formatter<local_time<Duration>, Char>
formatter<nested_view<T, Char>, Char>
formatter<std::optional<T>, Char>
formatter<std::reference_wrapper<T>, Char>
formatter</* implementation-defined */, Char>
formatter</* implementation-defined */, Char>
formatter<sys_time<Duration>, Char>
formatter<tuple_join_view<Tuple, Char>, Char>
formatter</* implementation-defined */, Char>
formatter<utc_time<Duration>, Char>
formatter<Char[], Char>
formatter<std::basic_string<Char, Traits, Allocator>, Char>
formatter<std::chrono::duration<Rep, Period>, Char>
formatter<std::expected<T, E>, Char>
formatter<join_view<It, Sentinel, Char>, Char>
formatter<T, Char, void_t</* implementation-defined */>>
fstring A compile-time format string. Use format_string in the public API to prevent type deduction.
generic_context
group_digits_view
is_compiled_string
is_contiguous
is_contiguous<basic_memory_buffer<T, SIZE, Allocator>>
is_contiguous<std::basic_string<Char, Traits, Allocator>>
is_range
is_tuple_formattable
is_tuple_like
is_variant_like
join_view
loc_value
locale_ref
monostate
month
nested_formatter
nested_view
parse_context Parsing context consisting of a format string range being parsed and an argument counter for automatic indexing.
parse_context<char>
path
printf_formatter
range_format_kind
range_formatter
range_formatter<T, Char>
rgb
runtime_format_string
static_format_result
string_buffer
text_style A text style consisting of foreground and background colors and emphasis.
tuple_join_view
vprintf_args
weekday
writer
year
year_month_day
appender
basic_format_context
basic_format_parse_context
basic_format_string
bool_constant
buffered_context
conditional_t
cstring_view
decay_t
enable_if_t
format_args
format_context
format_parse_context
format_string
is_formattable
local_time
make_unsigned_t
memory_buffer
nullptr_t
ostream_formatter
printf_args
printf_context
remove_const_t
remove_cvref_t
remove_reference_t
string_view
sys_time
underlying_t
utc_time
vargs
void_t
wcstring_view
wformat_args
wformat_context
wformat_parse_context
wformat_string
wmemory_buffer
wprintf_args
wprintf_context
wstring_view

Enums

Name
Unnamed enum
align
arg_id_kind
color
emphasis
presentation_type
range_format
sign
terminal_color

Functions

Name Description
Unnamed overloads
arg Returns a named argument to be used in a formatting function. It should only be used in a call to a formatting function.
assert_fail
bg Creates a text style from the background color.
fg Creates a text style from the foreground (text) color.
format format overloads
format_system_error Formats an error message for an error returned by an operating system or a language runtime, for example a file opening error, and writes it to out. The format is the same as the one used by std::system_error(ec, message) where ec is std::error_code(error_code, std::generic_category()). It is implementation-defined but normally looks like:
format_to format_to overloads
format_to_n Formats args according to specifications in fmt, writes up to n characters of the result to the output iterator out and returns the total (not truncated) output size and the iterator past the end of the output range. format_to_n does not append a terminating null character.
formatted_size Returns the number of chars in the output of format(fmt, args...).
fprintf Formats args according to specifications in fmt and writes the output to f.
gmtime Converts given time since epoch as std::time_t value into calendar time, expressed in Coordinated Universal Time (UTC). Unlike std::gmtime, this function is thread-safe on most platforms.
group_digits Returns a view that formats an integer value using ',' as a locale-independent thousands separator.
join join overloads
localtime Converts given time since epoch as std::time_t value into calendar time, expressed in local time. Unlike std::localtime, this function is thread-safe on most platforms.
make_format_args
make_printf_args Constructs an format_arg_store object that contains references to arguments and can be implicitly converted to printf_args.
make_wformat_args
max_of
min_of
operator| Bitwise disjunction operators
print print overloads
printf Formats args according to specifications in fmt and writes the output to stdout.
println println overloads
ptr Converts p to const void for pointer formatting.
report_error Reports a format error at compile time or, via a format_error exception, at runtime.
report_system_error
runtime Creates a runtime format string.
sprintf Formats args according to specifications in fmt and returns the result as as string.
streamed Returns a view that formats value via an ostream operator<<.
styled Returns an argument that will be formatted using ANSI escape sequences, to be used in a formatting function.
system_category
system_error Constructs std::system_error with a message formatted with fmt::format(fmt, args...). error_code is a system error code as given by errno.
to_string Converts value to std::string using the default format for type T.
to_wstring Converts value to std::wstring using the default format for type T.
underlying Converts e to the underlying type.
vformat
vformat_to vformat_to overloads
vformat_to_n
vfprintf
vprint
vprint_buffered
vprintf
vprintln
vsprintf
vsystem_error
operator== Equality operator
operator!= Inequality operator
operator< Less-than operator
operator<= Less-than-or-equal operator
operator> Greater-than operator
operator>= Greater-than-or-equal operator

Concepts

Name
formattable

fmt::enums namespace

Functions

Name
format_as

fmt::safe_duration_cast namespace

Functions

Name Description
lossless_integral_conversion Converts From to To, without loss. If the dynamic value of from can't be converted to To without loss, ec is set.
safe_duration_cast Safe duration_cast between floating point durations
safe_float_conversion converts From to To if possible, otherwise ec is set.

Namespaces

Name
enums
safe_duration_cast

Types

Name Description
basic_appender
basic_cstring_view A reference to a null-terminated string. It can be constructed from a C string or std::string.
basic_format_arg
basic_format_args A view of a collection of formatting arguments. To avoid lifetime issues it should only be used as a parameter type in type-erased functions such as vformat:
basic_fstring
basic_memory_buffer A dynamically growing memory buffer for trivially copyable/constructible types with the first SIZE elements stored in the object itself. Most commonly used via the memory_buffer alias for char.
basic_ostream_formatter
basic_printf_context
basic_specs
basic_string_view An implementation of std::basic_string_view for pre-C++17. It provides a subset of the API. fmt::basic_string_view is used for format strings even if std::basic_string_view is available to prevent issues when a library is compiled with a different -std option than the client code (which is not recommended).
buffered_file
bytes
compiled_string
conjunction
conjunction<P>
conjunction<P1, Pn...>
context
day
dynamic_format_arg_store A dynamic list of formatting arguments with storage.
file
format_error An error reported from a formatting function.
format_facet
format_facet<locale>
format_int A fast integer formatter.
format_specs
format_to_n_result
format_to_result
formatter
formatter</* implementation-defined */>
formatter<bytes>
formatter<std::error_code>
formatter<std::source_location>
formatter<group_digits_view<T>>
formatter<std::atomic_flag, Char>
formatter<std::byte, Char>
formatter<day, Char>
formatter</* implementation-defined */, Char>
formatter<std::thread::id, Char>
formatter<std::monostate, Char>
formatter<month, Char>
formatter<std::nullptr_t, Char>
formatter<std::filesystem::path, Char>
formatter<tm, Char>
formatter<std::type_info, Char>
formatter<weekday, Char>
formatter<year, Char>
formatter<year_month_day, Char>
formatter</* implementation-defined */, Char>
formatter<signed char, Char>
formatter<unsigned char, Char>
formatter<short, Char>
formatter<unsigned short, Char>
formatter<long, Char>
formatter<unsigned long, Char>
formatter<Char*, Char>
formatter<void*, Char>
formatter<BitRef, Char>
formatter<R, Char>
formatter<R, Char>
formatter<R, Char>
formatter<T, Char>
formatter<T, Char>
formatter<T, Char>
formatter<Tuple, Char>
formatter<Variant, Char>
formatter<std::atomic<T>, Char>
formatter<std::bitset<N>, Char>
formatter<std::complex<T>, Char>
formatter<local_time<Duration>, Char>
formatter<nested_view<T, Char>, Char>
formatter<std::optional<T>, Char>
formatter<std::reference_wrapper<T>, Char>
formatter</* implementation-defined */, Char>
formatter</* implementation-defined */, Char>
formatter<sys_time<Duration>, Char>
formatter<tuple_join_view<Tuple, Char>, Char>
formatter</* implementation-defined */, Char>
formatter<utc_time<Duration>, Char>
formatter<Char[], Char>
formatter<std::basic_string<Char, Traits, Allocator>, Char>
formatter<std::chrono::duration<Rep, Period>, Char>
formatter<std::expected<T, E>, Char>
formatter<join_view<It, Sentinel, Char>, Char>
formatter<T, Char, void_t</* implementation-defined */>>
fstring A compile-time format string. Use format_string in the public API to prevent type deduction.
generic_context
group_digits_view
is_compiled_string
is_contiguous
is_contiguous<basic_memory_buffer<T, SIZE, Allocator>>
is_contiguous<std::basic_string<Char, Traits, Allocator>>
is_range
is_tuple_formattable
is_tuple_like
is_variant_like
join_view
loc_value
locale_ref
monostate
month
nested_formatter
nested_view
parse_context Parsing context consisting of a format string range being parsed and an argument counter for automatic indexing.
parse_context<char>
path
printf_formatter
range_format_kind
range_formatter
range_formatter<T, Char>
rgb
runtime_format_string
static_format_result
string_buffer
text_style A text style consisting of foreground and background colors and emphasis.
tuple_join_view
vprintf_args
weekday
writer
year
year_month_day
appender
basic_format_context
basic_format_parse_context
basic_format_string
bool_constant
buffered_context
conditional_t
cstring_view
decay_t
enable_if_t
format_args
format_context
format_parse_context
format_string
is_formattable
local_time
make_unsigned_t
memory_buffer
nullptr_t
ostream_formatter
printf_args
printf_context
remove_const_t
remove_cvref_t
remove_reference_t
string_view
sys_time
underlying_t
utc_time
vargs
void_t
wcstring_view
wformat_args
wformat_context
wformat_parse_context
wformat_string
wmemory_buffer
wprintf_args
wprintf_context
wstring_view

Enums

Name
Unnamed enum
align
arg_id_kind
color
emphasis
presentation_type
range_format
sign
terminal_color

Functions

Name Description
Unnamed overloads
arg Returns a named argument to be used in a formatting function. It should only be used in a call to a formatting function.
assert_fail
bg Creates a text style from the background color.
fg Creates a text style from the foreground (text) color.
format format overloads
format_system_error Formats an error message for an error returned by an operating system or a language runtime, for example a file opening error, and writes it to out. The format is the same as the one used by std::system_error(ec, message) where ec is std::error_code(error_code, std::generic_category()). It is implementation-defined but normally looks like:
format_to format_to overloads
format_to_n Formats args according to specifications in fmt, writes up to n characters of the result to the output iterator out and returns the total (not truncated) output size and the iterator past the end of the output range. format_to_n does not append a terminating null character.
formatted_size Returns the number of chars in the output of format(fmt, args...).
fprintf Formats args according to specifications in fmt and writes the output to f.
gmtime Converts given time since epoch as std::time_t value into calendar time, expressed in Coordinated Universal Time (UTC). Unlike std::gmtime, this function is thread-safe on most platforms.
group_digits Returns a view that formats an integer value using ',' as a locale-independent thousands separator.
join join overloads
localtime Converts given time since epoch as std::time_t value into calendar time, expressed in local time. Unlike std::localtime, this function is thread-safe on most platforms.
make_format_args
make_printf_args Constructs an format_arg_store object that contains references to arguments and can be implicitly converted to printf_args.
make_wformat_args
max_of
min_of
operator| Bitwise disjunction operators
print print overloads
printf Formats args according to specifications in fmt and writes the output to stdout.
println println overloads
ptr Converts p to const void for pointer formatting.
report_error Reports a format error at compile time or, via a format_error exception, at runtime.
report_system_error
runtime Creates a runtime format string.
sprintf Formats args according to specifications in fmt and returns the result as as string.
streamed Returns a view that formats value via an ostream operator<<.
styled Returns an argument that will be formatted using ANSI escape sequences, to be used in a formatting function.
system_category
system_error Constructs std::system_error with a message formatted with fmt::format(fmt, args...). error_code is a system error code as given by errno.
to_string Converts value to std::string using the default format for type T.
to_wstring Converts value to std::wstring using the default format for type T.
underlying Converts e to the underlying type.
vformat
vformat_to vformat_to overloads
vformat_to_n
vfprintf
vprint
vprint_buffered
vprintf
vprintln
vsprintf
vsystem_error
operator== Equality operator
operator!= Inequality operator
operator< Less-than operator
operator<= Less-than-or-equal operator
operator> Greater-than operator
operator>= Greater-than-or-equal operator

Concepts

Name
formattable

Functions

Name
format_as

Synopsis

Declared in <fmt/format.h>
template<typename Enum>
constexpr
underlying_t<Enum>
format_as(Enum e) noexcept;


Functions

Name Description
lossless_integral_conversion Converts From to To, without loss. If the dynamic value of from can't be converted to To without loss, ec is set.
safe_duration_cast Safe duration_cast between floating point durations
safe_float_conversion converts From to To if possible, otherwise ec is set.
Converts From to To, without loss. If the dynamic value of from can't be converted to To without loss, ec is set.

Synopses

Declared in <fmt/chrono.h>
template<
    typename To,
    typename From>
constexpr
To
lossless_integral_conversion(
    From const from,
    int& ec);


» more... Converts From to To, without loss. If the dynamic value of from can't be converted to To without loss, ec is set.
template<
    typename To,
    typename From>
constexpr
To
lossless_integral_conversion(
    From const from,
    int& ec);


» more...
template<
    typename To,
    typename From>
constexpr
To
lossless_integral_conversion(
    From const from,
    int& ec);


» more...

Synopsis

Declared in <fmt/chrono.h>
template<
    typename To,
    typename From>
constexpr
To
lossless_integral_conversion(
    From const from,
    int& ec);


Converts From to To, without loss. If the dynamic value of from can't be converted to To without loss, ec is set.

Synopsis

Declared in <fmt/chrono.h>
template<
    typename To,
    typename From>
constexpr
To
lossless_integral_conversion(
    From const from,
    int& ec);


Synopsis

Declared in <fmt/chrono.h>
template<
    typename To,
    typename From>
constexpr
To
lossless_integral_conversion(
    From const from,
    int& ec);


Safe duration_cast between floating point durations

Synopsis

Declared in <fmt/chrono.h>
template<
    typename To,
    typename FromRep,
    typename FromPeriod>
To
safe_duration_cast(
    std::chrono::duration<FromRep, FromPeriod> from,
    int& ec);


converts From to To if possible, otherwise ec is set.

Synopses

Declared in <fmt/chrono.h>
template<
    typename To,
    typename From>
constexpr
To
safe_float_conversion(
    From const from,
    int& ec);


» more... converts From to To if possible, otherwise ec is set.
template<
    typename To,
    typename From>
constexpr
To
safe_float_conversion(
    From const from,
    int& ec);


» more...

Synopsis

Declared in <fmt/chrono.h>
template<
    typename To,
    typename From>
constexpr
To
safe_float_conversion(
    From const from,
    int& ec);


converts From to To if possible, otherwise ec is set.

Synopsis

Declared in <fmt/chrono.h>
template<
    typename To,
    typename From>
constexpr
To
safe_float_conversion(
    From const from,
    int& ec);


Description

input | output ---------------------------------|--------------- NaN | NaN Inf | Inf normal, fits in output | converted (possibly lossy) normal, does not fit in output | ec is set subnormal | best effort -Inf | -Inf

Synopsis

Declared in <fmt/base.h>
using appender = basic_appender<char>;


Synopsis

Declared in <fmt/base.h>
template<
    typename OutputIt,
    typename Char>
using basic_format_context = conditional_t<std::is_same<OutputIt, appender>::value, context, generic_context<OutputIt, Char>>;


Synopsis

Declared in <fmt/base.h>
template<typename Char>
using basic_format_parse_context = parse_context<Char>;


Synopsis

Declared in <fmt/xchar.h>
template<
    typename Char,
    typename... T>
using basic_format_string = basic_fstring<Char, T...>;


Synopsis

Declared in <fmt/base.h>
template<bool B>
using bool_constant = std::integral_constant<bool, B>;


Synopsis

Declared in <fmt/base.h>
template<typename Char>
using buffered_context = conditional_t<std::is_same<Char, char>::value, context, generic_context<basic_appender<Char>, Char>>;


Synopsis

Declared in <fmt/base.h>
template<
    bool B,
    typename T,
    typename F>
using conditional_t = std::conditional<B, T, F>::type;


Synopsis

Declared in <fmt/os.h>
using cstring_view = basic_cstring_view<char>;


Synopsis

Declared in <fmt/base.h>
template<typename T>
using decay_t = std::decay<T>::type;


Synopsis

Declared in <fmt/base.h>
template<
    bool B,
    typename T = void>
using enable_if_t = T;


Synopsis

Declared in <fmt/base.h>
using format_args = basic_format_args<context>;


Synopsis

Declared in <fmt/base.h>
using format_context = context;


Synopsis

Declared in <fmt/base.h>
using format_parse_context = parse_context<char>;


Synopsis

Declared in <fmt/base.h>
template<typename... T>
using format_string = fstring<T...>::t;


Synopsis

Declared in <fmt/base.h>
template<
    typename T,
    typename Char = char>
using is_formattable = bool_constant<!std::is_same<detail::mapped_t<conditional_t<std::is_void<T>::value, int *, T>, Char>, void>::value>;


Synopsis

Declared in <fmt/chrono.h>
template<class Duration>
using local_time = std::chrono::time_point</* implementation-defined */, Duration>;


Synopsis

Declared in <fmt/base.h>
template<typename T>
using make_unsigned_t = std::make_unsigned<T>::type;


Synopsis

Declared in <fmt/format.h>
using memory_buffer = basic_memory_buffer<char>;


Synopsis

Declared in <fmt/base.h>
using nullptr_t = decltype(nullptr);


Synopsis

Declared in <fmt/ostream.h>
using ostream_formatter = basic_ostream_formatter<char>;


Synopsis

Declared in <fmt/printf.h>
using printf_args = basic_format_args<printf_context>;


Synopsis

Declared in <fmt/printf.h>
using printf_context = basic_printf_context<char>;


Synopsis

Declared in <fmt/base.h>
template<typename T>
using remove_const_t = std::remove_const<T>::type;


Synopsis

Declared in <fmt/base.h>
template<typename T>
using remove_cvref_t = std::remove_cv<remove_reference_t<T>>::type;


Synopsis

Declared in <fmt/base.h>
template<typename T>
using remove_reference_t = std::remove_reference<T>::type;


Synopsis

Declared in <fmt/base.h>
using string_view = basic_string_view<char>;


Synopsis

Declared in <fmt/chrono.h>
template<typename Duration>
using sys_time = std::chrono::time_point<std::chrono::system_clock, Duration>;


Synopsis

Declared in <fmt/base.h>
template<typename T>
using underlying_t = std::underlying_type<T>::type;


Synopsis

Declared in <fmt/chrono.h>
template<typename Duration>
using utc_time = std::chrono::time_point</* implementation-defined */, Duration>;


Synopsis

Declared in <fmt/base.h>
template<typename... T>
using vargs = /* implementation-defined */;


Synopsis

Declared in <fmt/base.h>
template<typename...>
using void_t = void;


Synopsis

Declared in <fmt/os.h>
using wcstring_view = basic_cstring_view<wchar_t>;


Synopsis

Declared in <fmt/xchar.h>
using wformat_args = basic_format_args<wformat_context>;


Synopsis

Declared in <fmt/xchar.h>
using wformat_context = buffered_context<wchar_t>;


Synopsis

Declared in <fmt/xchar.h>
using wformat_parse_context = parse_context<wchar_t>;


Synopsis

Declared in <fmt/xchar.h>
template<typename... T>
using wformat_string = basic_format_string<wchar_t, T...>::t;


Synopsis

Declared in <fmt/xchar.h>
using wmemory_buffer = basic_memory_buffer<wchar_t>;


Synopsis

Declared in <fmt/printf.h>
using wprintf_args = basic_format_args<wprintf_context>;


Synopsis

Declared in <fmt/printf.h>
using wprintf_context = basic_printf_context<wchar_t>;


Synopsis

Declared in <fmt/xchar.h>
using wstring_view = basic_string_view<wchar_t>;


Synopsis

Declared in <fmt/base.h>
template<typename T>
class basic_appender;


Types

Name
container_type

Member Functions

Name Description
basic_appender [constructor]Construct from buffer
operator= Assignment operator
operator* Dereference operator
operator++ Increment operators

Protected Data Members

Name
container

Synopsis

Declared in <fmt/base.h>
using container_type = /* implementation-defined */;


Construct from buffer

Synopsis

Declared in <fmt/base.h>
constexpr
basic_appender(/* implementation-defined */& buf);


Parameters

Name Description
buf The object to copy construct from
Assignment operator

Synopsis

Declared in <fmt/base.h>
constexpr
basic_appender&
operator=(T c);


Return Value

Reference to the current object

Parameters

Name Description
c The object to assign from
Dereference operator

Synopsis

Declared in <fmt/base.h>
constexpr
basic_appender&
operator*();


Return Value

Reference to the current object
Increment operators

Synopses

Declared in <fmt/base.h>
Increment operator
constexpr
basic_appender&
operator++();


» more... Increment operator
constexpr
basic_appender
operator++(int);


» more...
Increment operator

Synopsis

Declared in <fmt/base.h>
constexpr
basic_appender&
operator++();


Return Value

Reference to the current object
Increment operator

Synopsis

Declared in <fmt/base.h>
constexpr
basic_appender
operator++(int);


Return Value

Another instance of the object

Synopsis

Declared in <fmt/base.h>
/* implementation-defined */* container;


A reference to a null-terminated string. It can be constructed from a C string or std::string.

Synopsis

Declared in <fmt/os.h>
template<typename Char>
class basic_cstring_view;


Member Functions

Name Description
basic_cstring_view [constructor]Constructors
c_str Returns the pointer to a C string.

Description

You can use one of the following type aliases for common character types:

+---------------+-----------------------------+ | Type | Definition | +===============+=============================+ | cstring_view | basic_cstring_view<char> | +---------------+-----------------------------+ | wcstring_view | basic_cstring_view<wchar_t> | +---------------+-----------------------------+

This class is most useful as a parameter type for functions that wrap C APIs.

Constructors

Synopses

Declared in <fmt/os.h>
Constructs a string reference from an std::string object.
basic_cstring_view(std::basic_string<Char> const& s);


» more... Constructs a string reference object from a C string.
basic_cstring_view(Char const* s);


» more...
Constructs a string reference from an std::string object.

Synopsis

Declared in <fmt/os.h>
basic_cstring_view(std::basic_string<Char> const& s);


Parameters

Name Description
s The object to copy construct from
Constructs a string reference object from a C string.

Synopsis

Declared in <fmt/os.h>
basic_cstring_view(Char const* s);


Parameters

Name Description
s The object to construct from
Returns the pointer to a C string.

Synopsis

Declared in <fmt/os.h>
Char const*
c_str() const;


Return Value

the pointer to a C string.

Synopsis

Declared in <fmt/base.h>
template<typename Context>
class basic_format_arg;


Types

Name
handle

Member Functions

Name Description
basic_format_arg [constructor]Constructors
format_custom
type
visit Visits an argument dispatching to the appropriate visit method based on the argument type. For example, if the argument type is double then vis(value) will be called with the value of type double.
operator bool Conversion to bool

Friends

|===
Name Description
basic_format_args A view of a collection of formatting arguments. To avoid lifetime issues it should only be used as a parameter type in type-erased functions such as vformat:

Synopsis

Declared in <fmt/base.h>
class handle;


Member Functions

Name Description
handle [constructor]Construct from custom_value
format
Construct from custom_value

Synopsis

Declared in <fmt/base.h>
explicit
handle(/* implementation-defined */ custom);


Parameters

Name Description
custom The object to construct from

Synopsis

Declared in <fmt/base.h>
void
format(
    parse_context<char_type>& parse_ctx,
    Context& ctx) const;


Constructors

Synopses

Declared in <fmt/base.h>
Default constructor
constexpr
basic_format_arg();


» more... Construct from T
template<typename T>
basic_format_arg(T&& val);


» more...
basic_format_arg(
    /* implementation-defined */ const* args,
    size_t size);


» more...
Default constructor

Synopsis

Declared in <fmt/base.h>
constexpr
basic_format_arg();


Construct from T

Synopsis

Declared in <fmt/base.h>
template<typename T>
basic_format_arg(T&& val);


Parameters

Name Description
val The object to move construct from

Synopsis

Declared in <fmt/base.h>
basic_format_arg(
    /* implementation-defined */ const* args,
    size_t size);


Synopsis

Declared in <fmt/base.h>
bool
format_custom(
    char_type const* parse_begin,
    parse_context<char_type>& parse_ctx,
    Context& ctx);


Synopsis

Declared in <fmt/base.h>
/* implementation-defined */
type() const;


Visits an argument dispatching to the appropriate visit method based on the argument type. For example, if the argument type is double then vis(value) will be called with the value of type double.

Synopsis

Declared in <fmt/base.h>
template<typename Visitor>
[[always_inline]]
constexpr
decltype(vis(0))
visit(Visitor&& vis) const;


Conversion to bool

Synopsis

Declared in <fmt/base.h>
constexpr
explicit
operator bool() const noexcept;


Return Value

The object converted to bool
A view of a collection of formatting arguments. To avoid lifetime issues it should only be used as a parameter type in type-erased functions such as vformat:

Synopsis

Declared in <fmt/base.h>
template<typename Context>
class basic_format_args;


Types

Name
format_arg

Member Functions

Name Description
basic_format_args [constructor]Constructors
get Returns the argument with the specified id.
get_id
max_size

Data Members

Name
args_ [variant member]
values_ [variant member]

Description

void vlog(fmt::string_view fmt, fmt::format_args args); // OK fmt::format_args args = fmt::make_format_args(); // Dangling reference

Synopsis

Declared in <fmt/base.h>
using format_arg = basic_format_arg<Context>;


Constructors

Synopses

Declared in <fmt/base.h>
Default constructor
constexpr
basic_format_args();


» more... Construct from store
template<
    int NUM_ARGS,
    int NUM_NAMED_ARGS,
    unsigned long long DESC>
constexpr
basic_format_args(store<NUM_ARGS, NUM_NAMED_ARGS, DESC> const& s);


» more... Constructs a basic_format_args object from format_arg_store.
template<
    int NUM_ARGS,
    int NUM_NAMED_ARGS,
    unsigned long long DESC>
[[always_inline]]
constexpr
basic_format_args(store<NUM_ARGS, NUM_NAMED_ARGS, DESC> const& s);


» more... Constructs a basic_format_args object from a dynamic list of arguments.
constexpr
basic_format_args(
    format_arg const* args,
    int count,
    bool has_named = false);


» more...
Default constructor

Synopsis

Declared in <fmt/base.h>
constexpr
basic_format_args();


Construct from store

Synopsis

Declared in <fmt/base.h>
template<
    int NUM_ARGS,
    int NUM_NAMED_ARGS,
    unsigned long long DESC>
constexpr
basic_format_args(store<NUM_ARGS, NUM_NAMED_ARGS, DESC> const& s);


Parameters

Name Description
s The object to copy construct from
Constructs a basic_format_args object from format_arg_store.

Synopsis

Declared in <fmt/base.h>
template<
    int NUM_ARGS,
    int NUM_NAMED_ARGS,
    unsigned long long DESC>
[[always_inline]]
constexpr
basic_format_args(store<NUM_ARGS, NUM_NAMED_ARGS, DESC> const& s);


Parameters

Name Description
s The object to copy construct from
Constructs a basic_format_args object from a dynamic list of arguments.

Synopsis

Declared in <fmt/base.h>
constexpr
basic_format_args(
    format_arg const* args,
    int count,
    bool has_named = false);


Parameters

Name Description
args The object to construct from
Returns the argument with the specified id.

Synopses

Declared in <fmt/base.h>
Returns the argument with the specified id.
constexpr
format_arg
get(int id) const;


» more...
template<typename Char>
format_arg
get(basic_string_view<Char> name) const;


» more...
Returns the argument with the specified id.

Synopsis

Declared in <fmt/base.h>
constexpr
format_arg
get(int id) const;


Return Value

the argument with the specified id.

Synopsis

Declared in <fmt/base.h>
template<typename Char>
format_arg
get(basic_string_view<Char> name) const;


Synopsis

Declared in <fmt/base.h>
template<typename Char>
constexpr
int
get_id(basic_string_view<Char> name) const;


Synopsis

Declared in <fmt/base.h>
int
max_size() const;


Synopsis

Declared in <fmt/base.h>
basic_format_arg<Context> const* args_;


Synopsis

Declared in <fmt/base.h>
/* implementation-defined */ const* values_;


Synopsis

Declared in <fmt/xchar.h>
template<
    typename Char,
    typename... T>
struct basic_fstring;


Types

Name
t

Member Functions

Name Description
basic_fstring [constructor]Constructors
get
operator basic_string_view<Char> Conversion to basic_string_view

Synopsis

Declared in <fmt/xchar.h>
using t = basic_fstring;


Constructors

Synopses

Declared in <fmt/xchar.h>
Construct from runtime_format_string
basic_fstring(runtime_format_string<Char> fmt);


» more... Construct from S
template<typename S>
[[always_inline]]
basic_fstring(S const& value);


» more... Construct from S
template<typename S>
[[always_inline]]
consteval
basic_fstring(S const& s);


» more...
Construct from runtime_format_string

Synopsis

Declared in <fmt/xchar.h>
basic_fstring(runtime_format_string<Char> fmt);


Parameters

Name Description
fmt The object to construct from
Construct from S

Synopsis

Declared in <fmt/xchar.h>
template<typename S>
[[always_inline]]
basic_fstring(S const& value);


Parameters

Name Description
value The object to copy construct from
Construct from S

Synopsis

Declared in <fmt/xchar.h>
template<typename S>
[[always_inline]]
consteval
basic_fstring(S const& s);


Parameters

Name Description
s The object to copy construct from

Synopsis

Declared in <fmt/xchar.h>
basic_string_view<Char>
get() const;


Conversion to basic_string_view

Synopsis

Declared in <fmt/xchar.h>
operator basic_string_view<Char>() const;


Return Value

An implementation of std::basic_string_view for pre-C++17. It provides a subset of the API. fmt::basic_string_view is used for format strings even if std::basic_string_view is available to prevent issues when a library is compiled with a different -std option than the client code (which is not recommended).
A dynamically growing memory buffer for trivially copyable/constructible types with the first SIZE elements stored in the object itself. Most commonly used via the memory_buffer alias for char.

Synopsis

Declared in <fmt/format.h>
template<
    typename T,
    size_t SIZE = inline_buffer_size,
    typename Allocator = /* implementation-defined */>
class basic_memory_buffer
    : public /* implementation-defined */


Base Classes

Name Description
/* implementation-defined */A contiguous memory buffer with an optional growing ability. It is an internal class and shouldn't be used directly, only via memory_buffer.

Types

Name
const_reference
value_type

Member Functions

Name Description
basic_memory_buffer [constructor]Constructs a basic_memory_buffer object moving the content of the other object to it.
~basic_memory_buffer [destructor]Destructor
operator= Moves the content of the other basic_memory_buffer object to this one.
append
get_allocator
reserve Increases the buffer capacity to new_capacity.
resize Resizes the buffer to contain count elements. If T is a POD type new elements may not be initialized.

Description

*Example:

auto out = fmt::memory_buffer(); fmt::format_to(std::back_inserter(out), "The answer is {}.", 42);

This will append "The answer is 42." to out. The buffer content can be converted to std::string with to_string(out).

Synopsis

Declared in <fmt/format.h>
using const_reference = T const&;


Synopsis

Declared in <fmt/format.h>
using value_type = T;


Constructs a basic_memory_buffer object moving the content of the other object to it.

Synopses

Declared in <fmt/format.h>
Constructs a basic_memory_buffer object moving the content of the other object to it.
constexpr
basic_memory_buffer(basic_memory_buffer&& other) noexcept;


» more... Construct from Allocator
constexpr
explicit
basic_memory_buffer(Allocator const& alloc = Allocator());


» more...
Constructs a basic_memory_buffer object moving the content of the other object to it.

Synopsis

Declared in <fmt/format.h>
constexpr
basic_memory_buffer(basic_memory_buffer&& other) noexcept;


Parameters

Name Description
other The object to move construct from
Construct from Allocator

Synopsis

Declared in <fmt/format.h>
constexpr
explicit
basic_memory_buffer(Allocator const& alloc = Allocator());


Parameters

Name Description
alloc The object to copy construct from
Destructor

Synopsis

Declared in <fmt/format.h>
constexpr
~basic_memory_buffer();


Moves the content of the other basic_memory_buffer object to this one.

Synopsis

Declared in <fmt/format.h>
basic_memory_buffer&
operator=(basic_memory_buffer&& other) noexcept;


Return Value

Reference to the current object

Parameters

Name Description
other The object to move assign from

Synopsis

Declared in <fmt/format.h>
template<typename ContiguousRange>
constexpr
void
append(ContiguousRange const& range);


Synopsis

Declared in <fmt/format.h>
Allocator
get_allocator() const;


Increases the buffer capacity to new_capacity.

Synopsis

Declared in <fmt/format.h>
void
reserve(size_t new_capacity);


Resizes the buffer to contain count elements. If T is a POD type new elements may not be initialized.

Synopsis

Declared in <fmt/format.h>
constexpr
void
resize(size_t count);


Synopsis

Declared in <fmt/ostream.h>
template<typename Char>
struct basic_ostream_formatter
    : formatter<basic_string_view<Char>, Char>


Base Classes

Name Description
formatter<basic_string_view<Char>, Char>

Member Functions

Name
format
set_debug_format [deleted]

Derived Classes

Name Description
formatter
formatter

Synopsis

Declared in <fmt/ostream.h>
template<
    typename T,
    typename Context>
decltype(ctx.out())
format(
    T const& value,
    Context& ctx) const;


Synopsis

Declared in <fmt/ostream.h>
void
set_debug_format() = delete;


Synopsis

Declared in <fmt/printf.h>
template<typename Char>
class basic_printf_context;


Types

Name
char_type
formatter_type
parse_context_type

Enums

Name
Unnamed enum

Member Functions

Name Description
basic_printf_context [constructor]Constructs a printf_context object. References to the arguments are stored in the context object so make sure they have appropriate lifetimes.
advance_to
arg
locale
out

Synopsis

Declared in <fmt/printf.h>
using char_type = Char;


Synopsis

Declared in <fmt/printf.h>
template<typename T>
using formatter_type = printf_formatter<T>;


Synopsis

Declared in <fmt/printf.h>
using parse_context_type = parse_context<Char>;


Synopsis

Declared in <fmt/printf.h>
enum Unnamed enum;


Members

Name Description
builtin_types
Constructs a printf_context object. References to the arguments are stored in the context object so make sure they have appropriate lifetimes.

Synopsis

Declared in <fmt/printf.h>
basic_printf_context(
    basic_appender<Char> out,
    basic_format_args<basic_printf_context> args);


Parameters

Name Description
out The object to construct from
args A view of a collection of formatting arguments. To avoid lifetime issues it should only be used as a parameter type in type-erased functions such as vformat:

Synopsis

Declared in <fmt/printf.h>
void
advance_to(basic_appender<Char>);


Synopsis

Declared in <fmt/printf.h>
basic_format_arg<basic_printf_context>
arg(int id) const;


Synopsis

Declared in <fmt/printf.h>
locale_ref
locale();


Synopsis

Declared in <fmt/printf.h>
basic_appender<Char>
out();


Synopsis

Declared in <fmt/base.h>
class basic_specs;


Member Functions

Name Description
align
alt
clear_alt
copy_fill_from
dynamic
dynamic_precision
dynamic_width
fill
fill_size
fill_unit
localized
set_align
set_alt
set_dynamic_precision
set_dynamic_width
set_fill
set_localized
set_sign
set_type
set_upper
sign
type
upper

Derived Classes

Name Description
format_specs

Synopsis

Declared in <fmt/base.h>
constexpr
align
align() const;


Synopsis

Declared in <fmt/base.h>
constexpr
bool
alt() const;


Synopsis

Declared in <fmt/base.h>
constexpr
void
clear_alt();


Synopsis

Declared in <fmt/base.h>
constexpr
void
copy_fill_from(basic_specs const& specs);


Synopsis

Declared in <fmt/base.h>
constexpr
bool
dynamic() const;


Synopsis

Declared in <fmt/base.h>
constexpr
arg_id_kind
dynamic_precision() const;


Synopsis

Declared in <fmt/base.h>
constexpr
arg_id_kind
dynamic_width() const;


Synopses

Declared in <fmt/base.h>
template<typename Char>
constexpr
Char const*
fill() const;


» more...
template<typename Char>
constexpr
Char const*
fill() const;


» more...

Synopsis

Declared in <fmt/base.h>
template<typename Char>
constexpr
Char const*
fill() const;


Synopsis

Declared in <fmt/base.h>
template<typename Char>
constexpr
Char const*
fill() const;


Synopsis

Declared in <fmt/base.h>
constexpr
size_t
fill_size() const;


Synopsis

Declared in <fmt/base.h>
template<typename Char>
constexpr
Char
fill_unit() const;


Synopsis

Declared in <fmt/base.h>
constexpr
bool
localized() const;


Synopsis

Declared in <fmt/base.h>
constexpr
void
set_align(fmt::align a);


Synopsis

Declared in <fmt/base.h>
constexpr
void
set_alt();


Synopsis

Declared in <fmt/base.h>
constexpr
void
set_dynamic_precision(arg_id_kind p);


Synopsis

Declared in <fmt/base.h>
constexpr
void
set_dynamic_width(arg_id_kind w);


Synopses

Declared in <fmt/base.h>
constexpr
void
set_fill(char c);


» more...
template<typename Char>
constexpr
void
set_fill(basic_string_view<Char> s);


» more...

Synopsis

Declared in <fmt/base.h>
constexpr
void
set_fill(char c);


Synopsis

Declared in <fmt/base.h>
template<typename Char>
constexpr
void
set_fill(basic_string_view<Char> s);


Synopsis

Declared in <fmt/base.h>
constexpr
void
set_localized();


Synopsis

Declared in <fmt/base.h>
constexpr
void
set_sign(fmt::sign s);


Synopsis

Declared in <fmt/base.h>
constexpr
void
set_type(presentation_type t);


Synopsis

Declared in <fmt/base.h>
constexpr
void
set_upper();


Synopsis

Declared in <fmt/base.h>
constexpr
sign
sign() const;


Synopsis

Declared in <fmt/base.h>
constexpr
presentation_type
type() const;


Synopsis

Declared in <fmt/base.h>
constexpr
bool
upper() const;


An implementation of std::basic_string_view for pre-C++17. It provides a subset of the API. fmt::basic_string_view is used for format strings even if std::basic_string_view is available to prevent issues when a library is compiled with a different -std option than the client code (which is not recommended).

Synopsis

Declared in <fmt/base.h>
template<typename Char>
class basic_string_view;


Types

Name
iterator
value_type

Member Functions

Name Description
basic_string_view [constructor]Constructors
begin
compare
data Returns a pointer to the string data.
end
operator[]
remove_prefix
size Returns the string size.
starts_with

Friends

|===
Name Description
operator>= Greater-than-or-equal operator
operator> Greater-than operator
operator<= Less-than-or-equal operator
operator< Less-than operator
operator!= Inequality operator
operator== Equality operator

Synopsis

Declared in <fmt/base.h>
using iterator = Char const*;


Synopsis

Declared in <fmt/base.h>
using value_type = Char;


Constructors

Synopses

Declared in <fmt/base.h>
Default constructor
constexpr
basic_string_view() noexcept;


» more... Construct from nullptr_t
constexpr
basic_string_view(nullptr_t value) = delete;


» more... Construct from Char
constexpr
basic_string_view(Char const* s);


» more... Constructs a string view from a std::basic_string or a std::basic_string_view object.
template<typename S>
constexpr
basic_string_view(S const& s) noexcept;


» more... Constructs a string view object from a C string and a size.
constexpr
basic_string_view(
    Char const* s,
    size_t count) noexcept;


» more...
Default constructor

Synopsis

Declared in <fmt/base.h>
constexpr
basic_string_view() noexcept;


Construct from nullptr_t

Synopsis

Declared in <fmt/base.h>
constexpr
basic_string_view(nullptr_t value) = delete;


Parameters

Name Description
value The object to construct from
Construct from Char

Synopsis

Declared in <fmt/base.h>
constexpr
basic_string_view(Char const* s);


Parameters

Name Description
s The object to construct from
Constructs a string view from a std::basic_string or a std::basic_string_view object.

Synopsis

Declared in <fmt/base.h>
template<typename S>
constexpr
basic_string_view(S const& s) noexcept;


Parameters

Name Description
s The object to copy construct from
Constructs a string view object from a C string and a size.

Synopsis

Declared in <fmt/base.h>
constexpr
basic_string_view(
    Char const* s,
    size_t count) noexcept;


Parameters

Name Description
s The object to construct from

Synopsis

Declared in <fmt/base.h>
constexpr
iterator
begin() const noexcept;


Synopsis

Declared in <fmt/base.h>
constexpr
int
compare(basic_string_view other) const;


Returns a pointer to the string data.

Synopsis

Declared in <fmt/base.h>
constexpr
Char const*
data() const noexcept;


Return Value

a pointer to the string data.

Synopsis

Declared in <fmt/base.h>
constexpr
iterator
end() const noexcept;


Synopsis

Declared in <fmt/base.h>
constexpr
Char const&
operator[](size_t pos) const noexcept;


Synopsis

Declared in <fmt/base.h>
constexpr
void
remove_prefix(size_t n) noexcept;


Returns the string size.

Synopsis

Declared in <fmt/base.h>
constexpr
size_t
size() const noexcept;


Return Value

the string size.

Synopses

Declared in <fmt/base.h>
constexpr
bool
starts_with(Char c) const noexcept;


» more...
constexpr
bool
starts_with(basic_string_view<Char> sv) const noexcept;


» more...
constexpr
bool
starts_with(Char const* s) const;


» more...

Synopsis

Declared in <fmt/base.h>
constexpr
bool
starts_with(Char c) const noexcept;


Synopsis

Declared in <fmt/base.h>
constexpr
bool
starts_with(basic_string_view<Char> sv) const noexcept;


Synopsis

Declared in <fmt/base.h>
constexpr
bool
starts_with(Char const* s) const;


Synopsis

Declared in <fmt/os.h>
class buffered_file;


Member Functions

Name Description
buffered_file [constructor]Constructors
~buffered_file [destructor]Destructor
operator= [deleted]Assignment operators
close
descriptor
get
print

Friends

|===
Name Description
file
Constructors

Synopses

Declared in <fmt/os.h>
Default constructor
buffered_file() noexcept;


» more... Copy constructor
buffered_file(buffered_file const& other) = delete;


» more... Move constructor
buffered_file(buffered_file&& other) noexcept;


» more...
buffered_file(
    cstring_view filename,
    cstring_view mode);


» more...
Default constructor

Synopsis

Declared in <fmt/os.h>
buffered_file() noexcept;


Copy constructor

Synopsis

Declared in <fmt/os.h>
buffered_file(buffered_file const& other) = delete;


Parameters

Name Description
other The object to copy construct from
Move constructor

Synopsis

Declared in <fmt/os.h>
buffered_file(buffered_file&& other) noexcept;


Parameters

Name Description
other The object to move construct from

Synopsis

Declared in <fmt/os.h>
buffered_file(
    cstring_view filename,
    cstring_view mode);


Destructor

Synopsis

Declared in <fmt/os.h>
~buffered_file() noexcept;


Assignment operators

Synopses

Declared in <fmt/os.h>
void
operator=(buffered_file const& other) = delete;


» more... Move assignment operator
buffered_file&
operator=(buffered_file&& other);


» more...

Synopsis

Declared in <fmt/os.h>
void
operator=(buffered_file const& other) = delete;


Move assignment operator

Synopsis

Declared in <fmt/os.h>
buffered_file&
operator=(buffered_file&& other);


Return Value

Reference to the current object

Parameters

Name Description
other The object to move assign from

Synopsis

Declared in <fmt/os.h>
void
close();


Synopsis

Declared in <fmt/os.h>
int
descriptor() const;


Synopsis

Declared in <fmt/os.h>
FILE*
get() const noexcept;


Synopsis

Declared in <fmt/os.h>
template<typename... T>
void
print(
    string_view fmt,
    T const...&... args);


Synopsis

Declared in <fmt/format.h>
struct bytes;


Member Functions

Name Description
bytes [constructor]Construct from string_view

Data Members

Name
data
Construct from string_view

Synopsis

Declared in <fmt/format.h>
explicit
bytes(string_view s);


Parameters

Name Description
s The object to construct from

Synopsis

Declared in <fmt/format.h>
string_view data;


Synopsis

Declared in <fmt/compile.h>
class compiled_string;


Synopsis

Declared in <fmt/ranges.h>
template<typename...>
struct conjunction
    : std::true_type


Base Classes

Name Description
std::true_type

Synopsis

Declared in <fmt/ranges.h>
template<typename P>
struct conjunction<P>
    : P


Base Classes

Name Description
P

Synopsis

Declared in <fmt/ranges.h>
template<
    typename P1,
    typename... Pn>
struct conjunction<P1, Pn...>
    : conditional_t<bool(P1::value), conjunction<Pn...>, P1>


Base Classes

Name Description
conditional_t<bool(P1::value), conjunction<Pn...>, P1>

Synopsis

Declared in <fmt/base.h>
class context;


Types

Name
char_type
format_arg
iterator

Enums

Name
Unnamed enum

Member Functions

Name Description
context [constructor] [deleted]Constructs a context object. References to the arguments are stored in the object so make sure they have appropriate lifetimes.
operator= [deleted]
advance_to
arg
arg_id
args
locale
out

Synopsis

Declared in <fmt/base.h>
using char_type = char;


Synopsis

Declared in <fmt/base.h>
using format_arg = basic_format_arg<context>;


Synopsis

Declared in <fmt/base.h>
using iterator = appender;


Synopsis

Declared in <fmt/base.h>
enum Unnamed enum;


Members

Name Description
builtin_types
Constructs a context object. References to the arguments are stored in the object so make sure they have appropriate lifetimes.

Synopses

Declared in <fmt/base.h>
Copy constructor
context(context const& other) = delete;


» more... Move constructor
constexpr
context(context&& other) = default;


» more... Constructs a context object. References to the arguments are stored in the object so make sure they have appropriate lifetimes.
constexpr
context(
    iterator out,
    format_args args,
    locale_ref loc = {});


» more...
Copy constructor

Synopsis

Declared in <fmt/base.h>
context(context const& other) = delete;


Parameters

Name Description
other The object to copy construct from
Move constructor

Synopsis

Declared in <fmt/base.h>
constexpr
context(context&& other) = default;


Parameters

Name Description
other The object to move construct from
Constructs a context object. References to the arguments are stored in the object so make sure they have appropriate lifetimes.

Synopsis

Declared in <fmt/base.h>
constexpr
context(
    iterator out,
    format_args args,
    locale_ref loc = {});


Parameters

Name Description
out The object to construct from

Synopsis

Declared in <fmt/base.h>
void
operator=(context const& other) = delete;


Synopsis

Declared in <fmt/base.h>
constexpr
void
advance_to(iterator);


Synopses

Declared in <fmt/base.h>
format_arg
arg(string_view name) const;


» more...
constexpr
format_arg
arg(int id) const;


» more...

Synopsis

Declared in <fmt/base.h>
format_arg
arg(string_view name) const;


Synopsis

Declared in <fmt/base.h>
constexpr
format_arg
arg(int id) const;


Synopsis

Declared in <fmt/base.h>
constexpr
int
arg_id(string_view name) const;


Synopsis

Declared in <fmt/base.h>
format_args const&
args() const;


Synopsis

Declared in <fmt/base.h>
constexpr
locale_ref
locale() const;


Synopsis

Declared in <fmt/base.h>
constexpr
iterator
out() const;


Synopsis

Declared in <fmt/chrono.h>
class day;


Member Functions

Name Description
day [constructor]Constructors
operator unsigned int Conversion to unsigned int
Constructors

Synopses

Declared in <fmt/chrono.h>
Default constructor
constexpr
day() = default;


» more... Construct from unsigned int
constexpr
explicit
day(unsigned int d) noexcept;


» more...
Default constructor

Synopsis

Declared in <fmt/chrono.h>
constexpr
day() = default;


Construct from unsigned int

Synopsis

Declared in <fmt/chrono.h>
constexpr
explicit
day(unsigned int d) noexcept;


Parameters

Name Description
d The value to construct from
Conversion to unsigned int

Synopsis

Declared in <fmt/chrono.h>
constexpr
explicit
operator unsigned int() const noexcept;


Return Value

The object converted to unsigned int
A dynamic list of formatting arguments with storage.

Synopsis

Declared in <fmt/args.h>
template<typename Context>
class dynamic_format_arg_store;


Member Functions

Name Description
dynamic_format_arg_store [constructor]Default constructor
clear Erase all elements from the store.
push_back push_back overloads
reserve Reserves space to store at least new_cap arguments including new_cap_named named arguments.
size Returns the number of elements in the store.
operator basic_format_args<Context> Conversion to basic_format_args

Friends

|===
Name Description
basic_format_args A view of a collection of formatting arguments. To avoid lifetime issues it should only be used as a parameter type in type-erased functions such as vformat:

Description

It can be implicitly converted into fmt::basic_format_args for passing into type-erased formatting functions such as fmt::vformat.

Default constructor

Synopsis

Declared in <fmt/args.h>
constexpr
dynamic_format_arg_store() = default;


Erase all elements from the store.

Synopsis

Declared in <fmt/args.h>
void
clear();


push_back overloads

Synopses

Declared in <fmt/args.h>
Adds a reference to the argument into the dynamic store for later passing to a formatting function.
template<typename T>
void
push_back(std::reference_wrapper<T> arg);


» more... Adds an argument into the dynamic store for later passing to a formatting function.
template<typename T>
void
push_back(T const& arg);


» more... Adds named argument into the dynamic store for later passing to a formatting function. std::reference_wrapper is supported to avoid copying of the argument. The name is always copied into the store.
template<typename T>
void
push_back(/* implementation-defined */ const& arg);


» more...
Adds a reference to the argument into the dynamic store for later passing to a formatting function.

Synopsis

Declared in <fmt/args.h>
template<typename T>
void
push_back(std::reference_wrapper<T> arg);


Description

*Example:

fmt::dynamic_format_arg_store<fmt::format_context> store; char band[] = "Rolling Stones"; store.push_back(std::cref(band)); band[9] = 'c'; // Changing str affects the output. std::string result = fmt::vformat("{}", store); // result == "Rolling Scones"

Adds an argument into the dynamic store for later passing to a formatting function.

Synopsis

Declared in <fmt/args.h>
template<typename T>
void
push_back(T const& arg);


Description

Note that custom types and string types (but not string views) are copied into the store dynamically allocating memory if necessary.

*Example:

fmt::dynamic_format_arg_store<fmt::format_context> store; store.push_back(42); store.push_back("abc"); store.push_back(1.5f); std::string result = fmt::vformat("{} and {} and {}", store);

Adds named argument into the dynamic store for later passing to a formatting function. std::reference_wrapper is supported to avoid copying of the argument. The name is always copied into the store.

Synopsis

Declared in <fmt/args.h>
template<typename T>
void
push_back(/* implementation-defined */ const& arg);


Reserves space to store at least new_cap arguments including new_cap_named named arguments.

Synopsis

Declared in <fmt/args.h>
void
reserve(
    size_t new_cap,
    size_t new_cap_named);


Returns the number of elements in the store.

Synopsis

Declared in <fmt/args.h>
size_t
size() const noexcept;


Return Value

the number of elements in the store.
Conversion to basic_format_args

Synopsis

Declared in <fmt/args.h>
operator basic_format_args<Context>() const;


Return Value

A view of a collection of formatting arguments. To avoid lifetime issues it should only be used as a parameter type in type-erased functions such as vformat:

Synopsis

Declared in <fmt/os.h>
class file;


An error reported from a formatting function.

Synopsis

Declared in <fmt/format.h>
class format_error
    : public std::runtime_error


Base Classes

Name Description
std::runtime_error

Member Functions

Name
operator=
what [virtual]

Using Declarations

Name
format_error

Synopsis

Declared in <stdexcept>
runtime_error&
operator=(runtime_error const& value) noexcept;


Synopsis

Declared in <stdexcept>
virtual
char const*
what() const noexcept override;


Synopsis

Declared in <fmt/format.h>
using std::runtime_error::format_error;


Synopsis

Declared in <fmt/format.h>
template<typename Locale>
class format_facet
    : public Locale::facet


Base Classes

Name Description
Locale::facet

Member Functions

Name Description
format_facet [constructor]Construct from Locale
format_facet [constructor]
put

Static Data Members

Name
id

Protected Member Functions

Name
do_put [virtual]
Construct from Locale

Synopsis

Declared in <fmt/format.h>
explicit
format_facet(Locale& loc);


Parameters

Name Description
loc The object to copy construct from

Synopsis

Declared in <fmt/format.h>
explicit
format_facet(
    string_view sep = "",
    std::string grouping = "\3",
    std::string decimal_point = ".");


Synopsis

Declared in <fmt/format.h>
bool
put(
    appender out,
    loc_value val,
    format_specs const& specs) const;


Synopsis

Declared in <fmt/format.h>
static
Locale::id id;


Synopsis

Declared in <fmt/format.h>
virtual
bool
do_put(
    appender out,
    loc_value val,
    format_specs const& specs) const;


Synopsis

Declared in <fmt/format.h>
template<>
class format_facet<locale>
    : public locale::facet


Base Classes

Name Description
locale::facet

Member Functions

Name Description
format_facet [constructor]Constructors
put

Static Data Members

Name
id

Protected Member Functions

Name
do_put [virtual]
Constructors

Synopses

Declared in <fmt/format.h>
Construct from locale
explicit
format_facet(locale& loc);


» more...
explicit
format_facet(
    string_view sep = "",
    std::string grouping = "\3",
    std::string decimal_point = ".");


» more...
Construct from locale

Synopsis

Declared in <fmt/format.h>
explicit
format_facet(locale& loc);


Parameters

Name Description
loc The object to copy construct from

Synopsis

Declared in <fmt/format.h>
explicit
format_facet(
    string_view sep = "",
    std::string grouping = "\3",
    std::string decimal_point = ".");


Synopsis

Declared in <fmt/format.h>
bool
put(
    appender out,
    loc_value val,
    format_specs const& specs) const;


Synopsis

Declared in <fmt/format.h>
static
locale::id id;


Synopsis

Declared in <fmt/format.h>
virtual
bool
do_put(
    appender out,
    loc_value val,
    format_specs const& specs) const;


A fast integer formatter.

Synopsis

Declared in <fmt/format.h>
class format_int;


Member Functions

Name Description
format_int [constructor]Constructors
c_str Returns a pointer to the output buffer content with terminating null character appended.
data Returns a pointer to the output buffer content. No terminating null character is appended.
size Returns the number of characters written to the output buffer.
str Returns the content of the output buffer as an std::string.
Constructors

Synopses

Declared in <fmt/format.h>
Construct from int
constexpr
explicit
format_int(int value);


» more... Construct from unsigned int
constexpr
explicit
format_int(unsigned int value);


» more... Construct from long
constexpr
explicit
format_int(long value);


» more... Construct from unsigned long
constexpr
explicit
format_int(unsigned long value);


» more... Construct from long long
constexpr
explicit
format_int(long long value);


» more... Construct from unsigned long long
constexpr
explicit
format_int(unsigned long long value);


» more...
Construct from int

Synopsis

Declared in <fmt/format.h>
constexpr
explicit
format_int(int value);


Parameters

Name Description
value The value to construct from
Construct from unsigned int

Synopsis

Declared in <fmt/format.h>
constexpr
explicit
format_int(unsigned int value);


Parameters

Name Description
value The value to construct from
Construct from long

Synopsis

Declared in <fmt/format.h>
constexpr
explicit
format_int(long value);


Parameters

Name Description
value The value to construct from
Construct from unsigned long

Synopsis

Declared in <fmt/format.h>
constexpr
explicit
format_int(unsigned long value);


Parameters

Name Description
value The value to construct from
Construct from long long

Synopsis

Declared in <fmt/format.h>
constexpr
explicit
format_int(long long value);


Parameters

Name Description
value The value to construct from
Construct from unsigned long long

Synopsis

Declared in <fmt/format.h>
constexpr
explicit
format_int(unsigned long long value);


Parameters

Name Description
value The value to construct from
Returns a pointer to the output buffer content with terminating null character appended.

Synopsis

Declared in <fmt/format.h>
constexpr
char const*
c_str() const;


Return Value

a pointer to the output buffer content with terminating null character appended.
Returns a pointer to the output buffer content. No terminating null character is appended.

Synopsis

Declared in <fmt/format.h>
constexpr
char const*
data() const;


Return Value

a pointer to the output buffer content. No terminating null character is appended.
Returns the number of characters written to the output buffer.

Synopsis

Declared in <fmt/format.h>
constexpr
size_t
size() const;


Return Value

the number of characters written to the output buffer.
Returns the content of the output buffer as an std::string.

Synopsis

Declared in <fmt/format.h>
std::string
str() const;


Synopsis

Declared in <fmt/base.h>
struct format_specs
    : basic_specs


Base Classes

Name Description
basic_specs

Member Functions

Name Description
format_specs [constructor]Default constructor
align
alt
clear_alt
copy_fill_from
dynamic
dynamic_precision
dynamic_width
fill
fill_size
fill_unit
localized
set_align
set_alt
set_dynamic_precision
set_dynamic_width
set_fill
set_localized
set_sign
set_type
set_upper
sign
type
upper

Data Members

Name
precision
width
Default constructor

Synopsis

Declared in <fmt/base.h>
constexpr
format_specs();


Synopsis

Declared in <fmt/base.h>
int precision;


Synopsis

Declared in <fmt/base.h>
int width;


Synopsis

Declared in <fmt/base.h>
template<typename OutputIt>
struct format_to_n_result;


Data Members

Name Description
out Iterator past the end of the output range.
size Total (not truncated) output size.

Non-Member Functions

Name Description
format_to_nFormats args according to specifications in fmt, writes up to n characters of the result to the output iterator out and returns the total (not truncated) output size and the iterator past the end of the output range. format_to_n does not append a terminating null character.
Iterator past the end of the output range.

Synopsis

Declared in <fmt/base.h>
OutputIt out;


Total (not truncated) output size.

Synopsis

Declared in <fmt/base.h>
size_t size;


Synopsis

Declared in <fmt/base.h>
struct format_to_result;


Member Functions

Name Description
operator char* Conversion to char

Data Members

Name Description
out Pointer to just after the last successful write in the array.
truncated Specifies if the output was truncated.
Conversion to char

Synopsis

Declared in <fmt/base.h>
constexpr
operator char*() const;


Return Value

The object converted to char
Pointer to just after the last successful write in the array.

Synopsis

Declared in <fmt/base.h>
char* out;


Specifies if the output was truncated.

Synopsis

Declared in <fmt/base.h>
bool truncated;


Synopsis

Declared in <fmt/base.h>
template<
    typename T,
    typename Char = char,
    typename Enable = void>
struct formatter;


Member Functions

Name Description
formatter [constructor] [deleted]Default constructor

Derived Classes

Name Description
basic_ostream_formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
formatter
Default constructor

Synopsis

Declared in <fmt/base.h>
formatter() = delete;


Synopsis

Declared in <fmt/format-inl.h>
template<>
struct formatter</* implementation-defined */>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/format-inl.h>
format_context::iterator
format(
    /* implementation-defined */ const& n,
    format_context& ctx) const;


Synopsis

Declared in <fmt/format-inl.h>
constexpr
format_parse_context::iterator
parse(format_parse_context& ctx);


Synopsis

Declared in <fmt/format.h>
template<>
struct formatter<bytes>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/format.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    bytes b,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/format.h>
constexpr
char const*
parse(parse_context& ctx);


Synopsis

Declared in <fmt/std.h>
template<>
struct formatter<std::error_code>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/std.h>
template<typename FormatContext>
constexpr
decltype(ctx.out())
format(
    std::error_code const& ec,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/std.h>
constexpr
char const*
parse(parse_context& ctx);


Synopsis

Declared in <fmt/std.h>
template<>
struct formatter<std::source_location>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    std::source_location const& loc,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/std.h>
constexpr
auto
parse(parse_context& ctx);


Synopsis

Declared in <fmt/format.h>
template<typename T>
struct formatter<group_digits_view<T>>
    : formatter<T>


Base Classes

Name Description
formatter<T>

Member Functions

Name
format
parse

Synopsis

Declared in <fmt/format.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    group_digits_view<T> view,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/format.h>
constexpr
char const*
parse(parse_context& ctx);


Synopsis

Declared in <fmt/std.h>
template<typename Char>
struct formatter<std::atomic_flag, Char>
    : formatter<bool, Char>


Base Classes

Name Description
formatter<bool, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    std::atomic_flag const& v,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/format.h>
template<typename Char>
struct formatter<std::byte, Char>
    : formatter<unsigned int, Char>


Base Classes

Name Description
formatter<unsigned int, Char>

Member Functions

Name
format

Static Member Functions

Name
format_as

Synopsis

Declared in <fmt/format.h>
template<typename Context>
decltype(ctx.out())
format(
    std::byte b,
    Context& ctx) const;


Synopsis

Declared in <fmt/format.h>
static
unsigned char
format_as(std::byte b);


Synopsis

Declared in <fmt/chrono.h>
template<typename Char>
struct formatter<day, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    day d,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/chrono.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/format.h>
template<typename Char>
struct formatter</* implementation-defined */, Char>
    : /* implementation-defined */


Base Classes

Name Description
/* implementation-defined */

Synopsis

Declared in <fmt/std.h>
template<typename Char>
struct formatter<std::thread::id, Char>
    : basic_ostream_formatter<Char>


Base Classes

Name Description
basic_ostream_formatter<Char>

Synopsis

Declared in <fmt/std.h>
template<typename Char>
struct formatter<std::monostate, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    std::monostate const&,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/std.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/chrono.h>
template<typename Char>
struct formatter<month, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    month m,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/chrono.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/format.h>
template<typename Char>
struct formatter<std::nullptr_t, Char>
    : formatter<void const*, Char>


Base Classes

Name Description
formatter<void const*, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
    std::nullptr_t value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/std.h>
template<typename Char>
struct formatter<std::filesystem::path, Char>;


Member Functions

Name
format
parse
set_debug_format

Synopsis

Declared in <fmt/std.h>
template<typename FormatContext>
auto
format(
    std::filesystem::path const& p,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/std.h>
constexpr
auto
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/std.h>
constexpr
void
set_debug_format(bool set = true);


Synopsis

Declared in <fmt/chrono.h>
template<typename Char>
struct formatter<tm, Char>;


Member Functions

Name
format
parse

Protected Member Functions

Name
do_format
do_parse
localized
set_localized

Synopsis

Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    tm const& tm,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/chrono.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/chrono.h>
template<
    typename Duration,
    typename FormatContext>
decltype(ctx.out())
do_format(
    tm const& tm,
    FormatContext& ctx,
    Duration const* subsecs) const;


Synopsis

Declared in <fmt/chrono.h>
constexpr
Char const*
do_parse(
    parse_context<Char>& ctx,
    bool has_timezone);


Synopsis

Declared in <fmt/chrono.h>
bool
localized() const;


Synopsis

Declared in <fmt/chrono.h>
constexpr
void
set_localized();


Synopsis

Declared in <fmt/std.h>
template<typename Char>
struct formatter<std::type_info, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/std.h>
template<typename Context>
decltype(ctx.out())
format(
    std::type_info const& ti,
    Context& ctx) const;


Synopsis

Declared in <fmt/std.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/chrono.h>
template<typename Char>
struct formatter<weekday, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    weekday wd,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/chrono.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/chrono.h>
template<typename Char>
struct formatter<year, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    year y,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/chrono.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/chrono.h>
template<typename Char>
struct formatter<year_month_day, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    year_month_day val,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/chrono.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/format.h>
template<typename Char>
struct formatter</* implementation-defined */, Char>
    : formatter<basic_string_view<Char>, Char>


Base Classes

Name Description
formatter<basic_string_view<Char>, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
    /* implementation-defined */ value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/format.h>
template<typename Char>
struct formatter<signed char, Char>
    : formatter<int, Char>


Base Classes

Name Description
formatter<int, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
    signed char value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/format.h>
template<typename Char>
struct formatter<unsigned char, Char>
    : formatter<unsigned int, Char>


Base Classes

Name Description
formatter<unsigned int, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
    unsigned char value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/format.h>
template<typename Char>
struct formatter<short, Char>
    : formatter<int, Char>


Base Classes

Name Description
formatter<int, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
    short value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/format.h>
template<typename Char>
struct formatter<unsigned short, Char>
    : formatter<unsigned int, Char>


Base Classes

Name Description
formatter<unsigned int, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
    unsigned short value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/format.h>
template<typename Char>
struct formatter<long, Char>
    : formatter</* implementation-defined */, Char>


Base Classes

Name Description
formatter</* implementation-defined */, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
    long value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/format.h>
template<typename Char>
struct formatter<unsigned long, Char>
    : formatter</* implementation-defined */, Char>


Base Classes

Name Description
formatter</* implementation-defined */, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
    unsigned long value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/format.h>
template<typename Char>
struct formatter<Char*, Char>
    : formatter<Char const*, Char>


Base Classes

Name Description
formatter<Char const*, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
    Char* value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/format.h>
template<typename Char>
struct formatter<void*, Char>
    : formatter<void const*, Char>


Base Classes

Name Description
formatter<void const*, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
    void* value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/std.h>
template<
    typename BitRef,
    typename Char>
requires detail::is_bit_reference_like<BitRef>::value
struct formatter<BitRef, Char>
    : formatter<bool, Char>


Base Classes

Name Description
formatter<bool, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/std.h>
template<typename FormatContext>
constexpr
decltype(ctx.out())
format(
    BitRef const& v,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/ranges.h>
template<
    typename R,
    typename Char>
requires range_format_kind<R, Char>::value == range_format::string ||
                range_format_kind<R, Char>::value ==
                    range_format::debug_string
struct formatter<R, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/ranges.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    range_type& range,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/ranges.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/ranges.h>
template<
    typename R,
    typename Char>
requires conjunction<
        bool_constant<range_format_kind<R, Char>::value == range_format::map>,
        detail::is_formattable_delayed<R, Char>>::value
struct formatter<R, Char>;


Member Functions

Name Description
formatter [constructor]Default constructor
format
parse
Default constructor

Synopsis

Declared in <fmt/ranges.h>
constexpr
formatter();


Synopsis

Declared in <fmt/ranges.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    map_type& map,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/ranges.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/ranges.h>
template<
    typename R,
    typename Char>
requires conjunction<
        bool_constant<
            range_format_kind<R, Char>::value != range_format::disabled &&
            range_format_kind<R, Char>::value != range_format::map &&
            range_format_kind<R, Char>::value != range_format::string &&
            range_format_kind<R, Char>::value != range_format::debug_string>,
        detail::is_formattable_delayed<R, Char>>::value
struct formatter<R, Char>;


Types

Name
nonlocking

Member Functions

Name Description
formatter [constructor]Default constructor
format
parse

Synopsis

Declared in <fmt/ranges.h>
using nonlocking = void;


Default constructor

Synopsis

Declared in <fmt/ranges.h>
constexpr
formatter();


Synopsis

Declared in <fmt/ranges.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    range_type& range,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/ranges.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/std.h>
template<
    typename T,
    typename Char>
requires std::is_base_of<std::exception, T>::value
struct formatter<T, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/std.h>
template<typename Context>
decltype(ctx.out())
format(
    std::exception const& ex,
    Context& ctx) const;


Synopsis

Declared in <fmt/std.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/ranges.h>
template<
    typename T,
    typename Char>
requires conjunction<detail::is_container_adaptor_like<T>,
                            bool_constant<range_format_kind<T, Char>::value ==
                                          range_format::disabled>>::value
struct formatter<T, Char>
    : formatter</* implementation-defined */, Char>


Base Classes

Name Description
formatter</* implementation-defined */, Char>

Types

Name
all

Member Functions

Name
format

Synopsis

Declared in <fmt/ranges.h>
using all = /* implementation-defined */;


Synopsis

Declared in <fmt/ranges.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    T const& value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/base.h>
template<
    typename T,
    typename Char>
requires detail::type_constant<T, Char>::value !=
                             detail::type::custom_type
struct formatter<T, Char>
    : /* implementation-defined */


Base Classes

Name Description
/* implementation-defined */

Synopsis

Declared in <fmt/ranges.h>
template<
    typename Tuple,
    typename Char>
requires fmt::is_tuple_like<Tuple>::value &&
                             fmt::is_tuple_formattable<Tuple, Char>::value
struct formatter<Tuple, Char>;


Member Functions

Name Description
formatter [constructor]Default constructor
format
parse
set_brackets
set_separator
Default constructor

Synopsis

Declared in <fmt/ranges.h>
constexpr
formatter();


Synopsis

Declared in <fmt/ranges.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    Tuple const& value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/ranges.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/ranges.h>
constexpr
void
set_brackets(
    basic_string_view<Char> open,
    basic_string_view<Char> close);


Synopsis

Declared in <fmt/ranges.h>
constexpr
void
set_separator(basic_string_view<Char> sep);


Synopsis

Declared in <fmt/std.h>
template<
    typename Variant,
    typename Char>
requires std::conjunction_v<
                     is_variant_like<Variant>,
                     detail::is_variant_formattable<Variant, Char>>
struct formatter<Variant, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    Variant const& value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/std.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/std.h>
template<
    typename T,
    typename Char>
requires is_formattable<T, Char>::value
struct formatter<std::atomic<T>, Char>
    : formatter<T, Char>


Base Classes

Name Description
formatter<T, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    std::atomic<T> const& v,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/std.h>
template<
    size_t N,
    typename Char>
struct formatter<std::bitset<N>, Char>
    : nested_formatter<basic_string_view<Char>, Char>


Base Classes

Name Description
nested_formatter<basic_string_view<Char>, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    std::bitset<N> const& bs,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/std.h>
template<
    typename T,
    typename Char>
struct formatter<std::complex<T>, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    std::complex<T> const& c,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/std.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/chrono.h>
template<
    typename Duration,
    typename Char>
struct formatter<local_time<Duration>, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    local_time<Duration> val,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/chrono.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/format.h>
template<
    typename T,
    typename Char>
struct formatter<nested_view<T, Char>, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/format.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    nested_view<T, Char> view,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/format.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/std.h>
template<
    typename T,
    typename Char>
requires is_formattable<T, Char>::value
struct formatter<std::optional<T>, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    std::optional<T> const& opt,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/std.h>
constexpr
auto
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/std.h>
template<
    typename T,
    typename Char>
requires is_formattable<remove_cvref_t<T>, Char>::value &&
                             !detail::has_format_as<T>::value &&
                             !detail::has_format_as_member<T>::value
struct formatter<std::reference_wrapper<T>, Char>
    : formatter<remove_cvref_t<T>, Char>


Base Classes

Name Description
formatter<remove_cvref_t<T>, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    std::reference_wrapper<T> ref,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/ostream.h>
template<
    typename T,
    typename Char>
struct formatter</* implementation-defined */, Char>
    : basic_ostream_formatter<Char>


Base Classes

Name Description
basic_ostream_formatter<Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/ostream.h>
template<typename Context>
decltype(ctx.out())
format(
    /* implementation-defined */ view,
    Context& ctx) const;


Synopsis

Declared in <fmt/color.h>
template<
    typename T,
    typename Char>
struct formatter</* implementation-defined */, Char>
    : formatter<T, Char>


Base Classes

Name Description
formatter<T, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/color.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    /* implementation-defined */ const& arg,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/chrono.h>
template<
    typename Char,
    typename Duration>
struct formatter<sys_time<Duration>, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    sys_time<Duration> val,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/chrono.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/ranges.h>
template<
    typename Tuple,
    typename Char>
requires is_tuple_like<Tuple>::value
struct formatter<tuple_join_view<Tuple, Char>, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/ranges.h>
template<typename FormatContext>
FormatContext::iterator
format(
    tuple_join_view<Tuple, Char> const& value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/ranges.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/format.h>
template<
    int N,
    typename Char>
struct formatter</* implementation-defined */, Char>
    : formatter<long long, Char>


Base Classes

Name Description
formatter<long long, Char>

Synopsis

Declared in <fmt/chrono.h>
template<
    typename Duration,
    typename Char>
struct formatter<utc_time<Duration>, Char>
    : formatter<sys_time<Duration>, Char>


Base Classes

Name Description
formatter<sys_time<Duration>, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    utc_time<Duration> val,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/format.h>
template<
    typename Char,
    size_t N>
struct formatter<Char[], Char>
    : formatter<basic_string_view<Char>, Char>


Base Classes

Name Description
formatter<basic_string_view<Char>, Char>

Synopsis

Declared in <fmt/format.h>
template<
    typename Char,
    typename Traits,
    typename Allocator>
class formatter<std::basic_string<Char, Traits, Allocator>, Char>
    : public formatter<basic_string_view<Char>, Char>


Base Classes

Name Description
formatter<basic_string_view<Char>, Char>

Synopsis

Declared in <fmt/chrono.h>
template<
    typename Rep,
    typename Period,
    typename Char>
struct formatter<std::chrono::duration<Rep, Period>, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    std::chrono::duration<Rep, Period> d,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/chrono.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/std.h>
template<
    typename T,
    typename E,
    typename Char>
requires (std::is_void<T>::value ||
                                   is_formattable<T, Char>::value) &&
                                  is_formattable<E, Char>::value
struct formatter<std::expected<T, E>, Char>;


Member Functions

Name
format
parse

Synopsis

Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    std::expected<T, E> const& value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/std.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/ranges.h>
template<
    typename It,
    typename Sentinel,
    typename Char>
struct formatter<join_view<It, Sentinel, Char>, Char>;


Types

Name
nonlocking

Member Functions

Name
format
parse

Synopsis

Declared in <fmt/ranges.h>
using nonlocking = void;


Synopsis

Declared in <fmt/ranges.h>
template<typename FormatContext>
decltype(ctx.out())
format(
    view& value,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/ranges.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/format.h>
template<
    typename T,
    typename Char>
struct formatter<T, Char, void_t</* implementation-defined */>>
    : formatter</* implementation-defined */, Char>


Base Classes

Name Description
formatter</* implementation-defined */, Char>

Member Functions

Name
format

Synopsis

Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype(ctx.out())
format(
    T const& value,
    FormatContext& ctx) const;


A compile-time format string. Use format_string in the public API to prevent type deduction.

Synopsis

Declared in <fmt/base.h>
template<typename... T>
struct fstring;


Types

Name
t

Member Functions

Name Description
fstring [constructor]Constructors
get
operator string_view const& Conversion to string_view

Data Members

Name
str

Synopsis

Declared in <fmt/base.h>
using t = fstring;


Constructors

Synopses

Declared in <fmt/base.h>
Construct from runtime_format_string
fstring(runtime_format_string fmt);


» more... Construct from S
template<typename S>
[[always_inline]]
fstring(S const& value);


» more... Construct from S
template<typename S>
[[always_inline]]
consteval
fstring(S const& s);


» more... Construct from char
template<size_t N>
[[always_inline]]
consteval
fstring(char const(& s)[]);


» more...
Construct from runtime_format_string

Synopsis

Declared in <fmt/base.h>
fstring(runtime_format_string fmt);


Parameters

Name Description
fmt The object to construct from
Construct from S

Synopsis

Declared in <fmt/base.h>
template<typename S>
[[always_inline]]
fstring(S const& value);


Parameters

Name Description
value The object to copy construct from
Construct from S

Synopsis

Declared in <fmt/base.h>
template<typename S>
[[always_inline]]
consteval
fstring(S const& s);


Parameters

Name Description
s The object to copy construct from
Construct from char

Synopsis

Declared in <fmt/base.h>
template<size_t N>
[[always_inline]]
consteval
fstring(char const(& s)[]);


Parameters

Name Description
s The value to construct from

Synopsis

Declared in <fmt/base.h>
string_view
get() const;


Conversion to string_view

Synopsis

Declared in <fmt/base.h>
[[always_inline]]
operator string_view const&() const;


Return Value

The object converted to string_view

Synopsis

Declared in <fmt/base.h>
string_view str;


Synopsis

Declared in <fmt/format.h>
template<
    typename OutputIt,
    typename Char>
class generic_context;


Types

Name
char_type
iterator

Enums

Name
Unnamed enum

Member Functions

Name Description
generic_context [constructor] [deleted]Constructors
operator= [deleted]
advance_to
arg
arg_id
locale
out

Synopsis

Declared in <fmt/format.h>
using char_type = Char;


Synopsis

Declared in <fmt/format.h>
using iterator = OutputIt;


Synopsis

Declared in <fmt/format.h>
enum Unnamed enum;


Members

Name Description
builtin_types
Constructors

Synopses

Declared in <fmt/format.h>
Copy constructor
generic_context(generic_context const& other) = delete;


» more... Move constructor
generic_context(generic_context&& other) = default;


» more...
constexpr
generic_context(
    OutputIt out,
    basic_format_args<generic_context> args,
    locale_ref loc = {});


» more...
Copy constructor

Synopsis

Declared in <fmt/format.h>
generic_context(generic_context const& other) = delete;


Parameters

Name Description
other The object to copy construct from
Move constructor

Synopsis

Declared in <fmt/format.h>
generic_context(generic_context&& other) = default;


Parameters

Name Description
other The object to move construct from

Synopsis

Declared in <fmt/format.h>
constexpr
generic_context(
    OutputIt out,
    basic_format_args<generic_context> args,
    locale_ref loc = {});


Synopsis

Declared in <fmt/format.h>
void
operator=(generic_context const& other) = delete;


Synopsis

Declared in <fmt/format.h>
void
advance_to(iterator it);


Synopses

Declared in <fmt/format.h>
basic_format_arg<generic_context>
arg(basic_string_view<Char> name) const;


» more...
constexpr
basic_format_arg<generic_context>
arg(int id) const;


» more...

Synopsis

Declared in <fmt/format.h>
basic_format_arg<generic_context>
arg(basic_string_view<Char> name) const;


Synopsis

Declared in <fmt/format.h>
constexpr
basic_format_arg<generic_context>
arg(int id) const;


Synopsis

Declared in <fmt/format.h>
constexpr
int
arg_id(basic_string_view<Char> name) const;


Synopsis

Declared in <fmt/format.h>
constexpr
locale_ref
locale() const;


Synopsis

Declared in <fmt/format.h>
constexpr
iterator
out() const;


Synopsis

Declared in <fmt/format.h>
template<typename T>
struct group_digits_view;


Data Members

Name
value

Non-Member Functions

Name Description
group_digitsReturns a view that formats an integer value using ',' as a locale-independent thousands separator.

Synopsis

Declared in <fmt/format.h>
T value;


Synopsis

Declared in <fmt/compile.h>
template<typename S>
struct is_compiled_string
    : std::is_base_of<compiled_string, S>


Base Classes

Name Description
std::is_base_of<compiled_string, S>

Synopsis

Declared in <fmt/base.h>
template<typename T>
struct is_contiguous
    : std::false_type


Base Classes

Name Description
std::false_type

Synopsis

Declared in <fmt/format.h>
template<
    typename T,
    size_t SIZE,
    typename Allocator>
struct is_contiguous<basic_memory_buffer<T, SIZE, Allocator>>
    : std::true_type


Base Classes

Name Description
std::true_type

Synopsis

Declared in <fmt/format.h>
template<
    typename Char,
    typename Traits,
    typename Allocator>
struct is_contiguous<std::basic_string<Char, Traits, Allocator>>
    : std::true_type


Base Classes

Name Description
std::true_type

Synopsis

Declared in <fmt/ranges.h>
template<
    typename T,
    typename Char>
struct is_range;


Static Data Members

Name
value

Synopsis

Declared in <fmt/ranges.h>
inline constexpr static
bool value = detail::is_range_<T>::value && !detail::has_to_string_view<T>::value;


Synopsis

Declared in <fmt/ranges.h>
template<
    typename T,
    typename C>
struct is_tuple_formattable;


Static Data Members

Name
value

Synopsis

Declared in <fmt/ranges.h>
inline constexpr static
bool value = detail::is_tuple_formattable_<T, C>::value;


Synopsis

Declared in <fmt/ranges.h>
template<typename T>
struct is_tuple_like;


Static Data Members

Name
value

Synopsis

Declared in <fmt/ranges.h>
inline constexpr static
bool value = detail::is_tuple_like_<T>::value && !detail::is_range_<T>::value;


Synopsis

Declared in <fmt/std.h>
template<typename T>
struct is_variant_like;


Static Data Members

Name
value

Synopsis

Declared in <fmt/std.h>
inline constexpr static
bool value = detail::is_variant_like_<T>::value;


Synopsis

Declared in <fmt/ranges.h>
template<
    typename It,
    typename Sentinel,
    typename Char = char>
struct join_view
    : /* implementation-defined */


Base Classes

Name Description
/* implementation-defined */

Member Functions

Name
join_view [constructor]

Data Members

Name
begin
end
sep

Non-Member Functions

Name Description
joinReturns a view that formats the iterator range [begin, end) with elements separated by sep.
joinReturns a view that formats range with elements separated by sep.
joinReturns an object that formats std::initializer_list with elements separated by sep.

Synopsis

Declared in <fmt/ranges.h>
join_view(
    It b,
    Sentinel e,
    basic_string_view<Char> s);


Synopsis

Declared in <fmt/ranges.h>
It begin;


Synopsis

Declared in <fmt/ranges.h>
Sentinel end;


Synopsis

Declared in <fmt/ranges.h>
basic_string_view<Char> sep;


Synopsis

Declared in <fmt/format.h>
class loc_value;


Member Functions

Name Description
loc_value [constructor]Constructors
visit
Constructors

Synopses

Declared in <fmt/format.h>
Construct from T
template<typename T>
loc_value(T value);


» more... Construct from T
template<typename T>
loc_value(T value);


» more...
Construct from T

Synopsis

Declared in <fmt/format.h>
template<typename T>
loc_value(T value);


Parameters

Name Description
value The object to construct from
Construct from T

Synopsis

Declared in <fmt/format.h>
template<typename T>
loc_value(T value);


Parameters

Name Description
value The object to construct from

Synopsis

Declared in <fmt/format.h>
template<typename Visitor>
decltype(vis(0))
visit(Visitor&& vis);


Synopsis

Declared in <fmt/base.h>
class locale_ref;


Member Functions

Name Description
locale_ref [constructor]Constructors
get
operator bool Conversion to bool
Constructors

Synopses

Declared in <fmt/base.h>
Default constructor
constexpr
locale_ref();


» more... Construct from Locale
template<typename Locale>
requires (sizeof(Locale::collate) != 0)
locale_ref(Locale const& loc);


» more...
Default constructor

Synopsis

Declared in <fmt/base.h>
constexpr
locale_ref();


Construct from Locale

Synopsis

Declared in <fmt/base.h>
template<typename Locale>
requires (sizeof(Locale::collate) != 0)
locale_ref(Locale const& loc);


Parameters

Name Description
loc The object to copy construct from

Synopsis

Declared in <fmt/base.h>
template<typename Locale>
Locale
get() const;


Conversion to bool

Synopsis

Declared in <fmt/base.h>
explicit
operator bool() const noexcept;


Return Value

The object converted to bool

Synopsis

Declared in <fmt/base.h>
struct monostate;


Member Functions

Name Description
monostate [constructor]Default constructor
Default constructor

Synopsis

Declared in <fmt/base.h>
constexpr
monostate();


Synopsis

Declared in <fmt/chrono.h>
class month;


Member Functions

Name Description
month [constructor]Constructors
operator unsigned int Conversion to unsigned int
Constructors

Synopses

Declared in <fmt/chrono.h>
Default constructor
constexpr
month() = default;


» more... Construct from unsigned int
constexpr
explicit
month(unsigned int m) noexcept;


» more...
Default constructor

Synopsis

Declared in <fmt/chrono.h>
constexpr
month() = default;


Construct from unsigned int

Synopsis

Declared in <fmt/chrono.h>
constexpr
explicit
month(unsigned int m) noexcept;


Parameters

Name Description
m The value to construct from
Conversion to unsigned int

Synopsis

Declared in <fmt/chrono.h>
constexpr
explicit
operator unsigned int() const noexcept;


Return Value

The object converted to unsigned int

Synopsis

Declared in <fmt/format.h>
template<
    typename T,
    typename Char = char>
struct nested_formatter;


Member Functions

Name Description
nested_formatter [constructor]Default constructor
nested
parse
write_padded

Derived Classes

Name Description
formatter
Default constructor

Synopsis

Declared in <fmt/format.h>
constexpr
nested_formatter();


Synopsis

Declared in <fmt/format.h>
nested_view<T, Char>
nested(T const& value) const;


Synopsis

Declared in <fmt/format.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/format.h>
template<
    typename FormatContext,
    typename F>
decltype(ctx.out())
write_padded(
    FormatContext& ctx,
    F write) const;


Synopsis

Declared in <fmt/format.h>
template<
    typename T,
    typename Char>
struct nested_view;


Data Members

Name
fmt
value

Synopsis

Declared in <fmt/format.h>
formatter<T, Char> const* fmt;


Synopsis

Declared in <fmt/format.h>
T const* value;


Parsing context consisting of a format string range being parsed and an argument counter for automatic indexing.

Synopsis

Declared in <fmt/base.h>
template<typename Char = char>
class parse_context;


Types

Name
char_type
iterator

Member Functions

Name Description
parse_context [constructor]
advance_to Advances the begin iterator to it.
begin Returns an iterator to the beginning of the format string range being parsed.
check_arg_id Reports an error if using the automatic argument indexing; otherwise switches to the manual indexing.
check_dynamic_spec
end Returns an iterator past the end of the format string range being parsed.
next_arg_id Reports an error if using the manual argument indexing; otherwise returns the next argument index and switches to the automatic indexing.

Synopsis

Declared in <fmt/base.h>
using char_type = Char;


Synopsis

Declared in <fmt/base.h>
using iterator = Char const*;


Synopsis

Declared in <fmt/base.h>
constexpr
explicit
parse_context(
    basic_string_view<Char> fmt,
    int next_arg_id = 0);


Advances the begin iterator to it.

Synopsis

Declared in <fmt/base.h>
constexpr
void
advance_to(iterator it);


Returns an iterator to the beginning of the format string range being parsed.

Synopsis

Declared in <fmt/base.h>
constexpr
iterator
begin() const noexcept;


Return Value

an iterator to the beginning of the format string range being parsed.
Reports an error if using the automatic argument indexing; otherwise switches to the manual indexing.

Synopses

Declared in <fmt/base.h>
constexpr
void
check_arg_id(basic_string_view<Char>);


» more... Reports an error if using the automatic argument indexing; otherwise switches to the manual indexing.
constexpr
void
check_arg_id(int id);


» more...

Synopsis

Declared in <fmt/base.h>
constexpr
void
check_arg_id(basic_string_view<Char>);


Reports an error if using the automatic argument indexing; otherwise switches to the manual indexing.

Synopsis

Declared in <fmt/base.h>
constexpr
void
check_arg_id(int id);


Synopsis

Declared in <fmt/base.h>
constexpr
void
check_dynamic_spec(int arg_id);


Returns an iterator past the end of the format string range being parsed.

Synopsis

Declared in <fmt/base.h>
constexpr
iterator
end() const noexcept;


Return Value

an iterator past the end of the format string range being parsed.
Reports an error if using the manual argument indexing; otherwise returns the next argument index and switches to the automatic indexing.

Synopsis

Declared in <fmt/base.h>
constexpr
int
next_arg_id();


Synopsis

Declared in <fmt/base.h>
template<>
class parse_context<char>;


Types

Name
char_type
iterator

Member Functions

Name Description
parse_context [constructor]
advance_to
begin
check_arg_id
check_dynamic_spec
end
next_arg_id

Synopsis

Declared in <fmt/base.h>
using char_type = char;


Synopsis

Declared in <fmt/base.h>
using iterator = char const*;


Synopsis

Declared in <fmt/base.h>
constexpr
explicit
parse_context(
    basic_string_view<char> fmt,
    int next_arg_id = 0);


Synopsis

Declared in <fmt/base.h>
constexpr
void
advance_to(iterator it);


Synopsis

Declared in <fmt/base.h>
constexpr
iterator
begin() const noexcept;


Synopses

Declared in <fmt/base.h>
constexpr
void
check_arg_id(basic_string_view<char>);


» more...
constexpr
void
check_arg_id(int id);


» more...

Synopsis

Declared in <fmt/base.h>
constexpr
void
check_arg_id(basic_string_view<char>);


Synopsis

Declared in <fmt/base.h>
constexpr
void
check_arg_id(int id);


Synopsis

Declared in <fmt/base.h>
constexpr
void
check_dynamic_spec(int arg_id);


Synopsis

Declared in <fmt/base.h>
constexpr
iterator
end() const noexcept;


Synopsis

Declared in <fmt/base.h>
constexpr
int
next_arg_id();


Synopsis

Declared in <fmt/std.h>
class path
    : public std::filesystem::path


Base Classes

Name Description
std::filesystem::path

Types

Name
iterator
__string_view
const_iterator
string_type
value_type

Enums

Name
format

Member Functions

Name Description
operator= Assignment operators
__reserve
append
assign
begin
c_str
clear
compare
concat
display_string
empty
end
extension
filename
generic_display_string
generic_string
generic_system_string
generic_u16string
generic_u32string
generic_u8string
generic_wstring
has_extension
has_filename
has_parent_path
has_relative_path
has_root_directory
has_root_name
has_root_path
has_stem
is_absolute
is_relative
lexically_normal
lexically_proximate
lexically_relative
make_preferred
native
operator+= Addition assignment operators
operator/= Division assignment operators
parent_path
relative_path
remove_filename
replace_extension
replace_filename
root_directory
root_name
root_path
stem
string
swap
system_string
u16string
u32string
u8string
wstring
operator string_type Conversion to string_type

Static Data Members

Name
preferred_separator

Synopsis

Declared in <__filesystem/path.h>
typedef basic_string_view<value_type> __string_view;


Synopsis

Declared in <__filesystem/path.h>
typedef iterator const_iterator;


Synopsis

Declared in <__filesystem/path.h>
typedef basic_string<value_type> string_type;


Synopsis

Declared in <__filesystem/path.h>
typedef char value_type;


Synopsis

Declared in <__filesystem/path.h>
class iterator;


Friends

|===
Name Description
operator==
path

Synopsis

Declared in <__filesystem/path.h>
enum format : unsigned char;


Members

Name Description
Assignment operators

Synopses

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator=(path const& __p);


» more...
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator=(path&& __p) noexcept;


» more...
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator=(string_type&& __s) noexcept;


» more...
template<class _Source>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator=(_Source const& __src);


» more...

Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator=(path const& __p);


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator=(path&& __p) noexcept;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator=(string_type&& __s) noexcept;


Synopsis

Declared in <__filesystem/path.h>
template<class _Source>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator=(_Source const& __src);


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
void
__reserve(size_t __s);


Synopses

Declared in <__filesystem/path.h>
template<class _Source>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
append(_Source const& __src);


» more...
template<class _InputIt>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
append(
    _InputIt __first,
    _InputIt __last);


» more...

Synopsis

Declared in <__filesystem/path.h>
template<class _Source>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
append(_Source const& __src);


Synopsis

Declared in <__filesystem/path.h>
template<class _InputIt>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
append(
    _InputIt __first,
    _InputIt __last);


Synopses

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
assign(string_type&& __s) noexcept;


» more...
template<class _Source>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
assign(_Source const& __src);


» more...
template<class _InputIt>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
assign(
    _InputIt __first,
    _InputIt __last);


» more...

Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
assign(string_type&& __s) noexcept;


Synopsis

Declared in <__filesystem/path.h>
template<class _Source>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
assign(_Source const& __src);


Synopsis

Declared in <__filesystem/path.h>
template<class _InputIt>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
assign(
    _InputIt __first,
    _InputIt __last);


Synopsis

Declared in <__filesystem/path.h>
iterator
begin() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
value_type const*
c_str() const noexcept;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
void
clear() noexcept;


Synopses

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
int
compare(__string_view __s) const;


» more...
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
int
compare(path const& __p) const noexcept;


» more...
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
int
compare(string_type const& __s) const;


» more...
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
int
compare(value_type const* __s) const;


» more...

Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
int
compare(__string_view __s) const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
int
compare(path const& __p) const noexcept;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
int
compare(string_type const& __s) const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
int
compare(value_type const* __s) const;


Synopses

Declared in <__filesystem/path.h>
template<class _Source>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
concat(_Source const& __x);


» more...
template<class _InputIt>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
concat(
    _InputIt __first,
    _InputIt __last);


» more...

Synopsis

Declared in <__filesystem/path.h>
template<class _Source>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
concat(_Source const& __x);


Synopsis

Declared in <__filesystem/path.h>
template<class _InputIt>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
concat(
    _InputIt __first,
    _InputIt __last);


Synopsis

Declared in <fmt/std.h>
std::string
display_string() const;


Synopsis

Declared in <__filesystem/path.h>
[[__nodiscard__, __visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
bool
empty() const noexcept;


Synopsis

Declared in <__filesystem/path.h>
iterator
end() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path
extension() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path
filename() const;


Synopsis

Declared in <fmt/std.h>
std::string
generic_display_string() const;


Synopses

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
std::string
generic_string() const;


» more...
template<
    class _ECharT,
    class _Traits = char_traits<_ECharT>,
    class _Allocator = allocator<_ECharT>>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
basic_string<_ECharT, _Traits, _Allocator>
generic_string(_Allocator const& __a = _Allocator()) const;


» more...

Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
std::string
generic_string() const;


Synopsis

Declared in <__filesystem/path.h>
template<
    class _ECharT,
    class _Traits = char_traits<_ECharT>,
    class _Allocator = allocator<_ECharT>>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
basic_string<_ECharT, _Traits, _Allocator>
generic_string(_Allocator const& __a = _Allocator()) const;


Synopsis

Declared in <fmt/std.h>
std::string
generic_system_string() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
std::u16string
generic_u16string() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
std::u32string
generic_u32string() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
std::u8string
generic_u8string() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
std::wstring
generic_wstring() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
bool
has_extension() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
bool
has_filename() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
bool
has_parent_path() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
bool
has_relative_path() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
bool
has_root_directory() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
bool
has_root_name() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
bool
has_root_path() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
bool
has_stem() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
bool
is_absolute() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
bool
is_relative() const;


Synopsis

Declared in <__filesystem/path.h>
path
lexically_normal() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path
lexically_proximate(path const& __base) const;


Synopsis

Declared in <__filesystem/path.h>
path
lexically_relative(path const& __base) const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
make_preferred();


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
string_type const&
native() const noexcept;


Addition assignment operators

Synopses

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator+=(__string_view __x);


» more...
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator+=(value_type __x);


» more...
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator+=(path const& __x);


» more...
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator+=(string_type const& __x);


» more...
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator+=(value_type const* __x);


» more...
template<class _ECharT>
requires __can_convert_char<_ECharT>::value
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator+=(_ECharT __x);


» more...
template<class _Source>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator+=(_Source const& __x);


» more...

Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator+=(__string_view __x);


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator+=(value_type __x);


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator+=(path const& __x);


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator+=(string_type const& __x);


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator+=(value_type const* __x);


Synopsis

Declared in <__filesystem/path.h>
template<class _ECharT>
requires __can_convert_char<_ECharT>::value
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator+=(_ECharT __x);


Synopsis

Declared in <__filesystem/path.h>
template<class _Source>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator+=(_Source const& __x);


Division assignment operators

Synopses

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator/=(path const& __p);


» more...
template<class _Source>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator/=(_Source const& __src);


» more...

Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator/=(path const& __p);


Synopsis

Declared in <__filesystem/path.h>
template<class _Source>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
operator/=(_Source const& __src);


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path
parent_path() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path
relative_path() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
remove_filename();


Synopsis

Declared in <__filesystem/path.h>
path&
replace_extension(path const& __replacement = path());


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path&
replace_filename(path const& __replacement);


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path
root_directory() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path
root_name() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path
root_path() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
path
stem() const;


Synopses

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
std::string
string() const;


» more...
template<
    class _ECharT,
    class _Traits = char_traits<_ECharT>,
    class _Allocator = allocator<_ECharT>>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
basic_string<_ECharT, _Traits, _Allocator>
string(_Allocator const& __a = _Allocator()) const;


» more...

Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
std::string
string() const;


Synopsis

Declared in <__filesystem/path.h>
template<
    class _ECharT,
    class _Traits = char_traits<_ECharT>,
    class _Allocator = allocator<_ECharT>>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
basic_string<_ECharT, _Traits, _Allocator>
string(_Allocator const& __a = _Allocator()) const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
void
swap(path& __rhs) noexcept;


Synopsis

Declared in <fmt/std.h>
std::string
system_string() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
std::u16string
u16string() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
std::u32string
u32string() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
std::u8string
u8string() const;


Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
std::wstring
wstring() const;


Conversion to string_type

Synopsis

Declared in <__filesystem/path.h>
[[__visibility__, __exclude_from_explicit_instantiation__, __abi_tag__]]
operator string_type() const;


Return Value

The object converted to string_type

Synopsis

Declared in <__filesystem/path.h>
inline constexpr static
value_type preferred_separator = '/';


Synopsis

Declared in <fmt/printf.h>
template<typename T>
struct printf_formatter;


Member Functions

Name Description
printf_formatter [constructor] [deleted]Default constructor
Default constructor

Synopsis

Declared in <fmt/printf.h>
printf_formatter() = delete;


Synopsis

Declared in <fmt/ranges.h>
template<
    typename T,
    typename Char,
    typename Enable = void>
struct range_format_kind
    : conditional_t<is_range<T, Char>::value, /* implementation-defined */, std::integral_constant<range_format, range_format::disabled>>


Base Classes

Name Description
conditional_t<is_range<T, Char>::value, /* implementation-defined */, std::integral_constant<range_format, range_format::disabled>>

Synopsis

Declared in <fmt/ranges.h>
template<
    typename T,
    typename Char,
    typename Enable = void>
struct range_formatter;


Synopsis

Declared in <fmt/ranges.h>
template<
    typename T,
    typename Char>
requires conjunction<std::is_same<T, remove_cvref_t<T>>,
                            is_formattable<T, Char>>::value
struct range_formatter<T, Char>;


Member Functions

Name Description
range_formatter [constructor]Default constructor
format
parse
set_brackets
set_separator
underlying
Default constructor

Synopsis

Declared in <fmt/ranges.h>
constexpr
range_formatter();


Synopsis

Declared in <fmt/ranges.h>
template<
    typename R,
    typename FormatContext>
decltype(ctx.out())
format(
    R&& range,
    FormatContext& ctx) const;


Synopsis

Declared in <fmt/ranges.h>
constexpr
Char const*
parse(parse_context<Char>& ctx);


Synopsis

Declared in <fmt/ranges.h>
constexpr
void
set_brackets(
    basic_string_view<Char> open,
    basic_string_view<Char> close);


Synopsis

Declared in <fmt/ranges.h>
constexpr
void
set_separator(basic_string_view<Char> sep);


Synopsis

Declared in <fmt/ranges.h>
constexpr
/* implementation-defined */&
underlying();


Synopsis

Declared in <fmt/color.h>
struct rgb;


Member Functions

Name Description
rgb [constructor]Constructors

Data Members

Name
b
g
r
Constructors

Synopses

Declared in <fmt/color.h>
Default constructor
constexpr
rgb();


» more... Construct from color
constexpr
rgb(color hex);


» more... Construct from uint32_t
constexpr
rgb(uint32_t hex);


» more...
constexpr
rgb(
    uint8_t r_,
    uint8_t g_,
    uint8_t b_);


» more...
Default constructor

Synopsis

Declared in <fmt/color.h>
constexpr
rgb();


Construct from color

Synopsis

Declared in <fmt/color.h>
constexpr
rgb(color hex);


Parameters

Name Description
hex The object to construct from
Construct from uint32_t

Synopsis

Declared in <fmt/color.h>
constexpr
rgb(uint32_t hex);


Parameters

Name Description
hex The object to construct from

Synopsis

Declared in <fmt/color.h>
constexpr
rgb(
    uint8_t r_,
    uint8_t g_,
    uint8_t b_);


Synopsis

Declared in <fmt/color.h>
uint8_t b;


Synopsis

Declared in <fmt/color.h>
uint8_t g;


Synopsis

Declared in <fmt/color.h>
uint8_t r;


Synopsis

Declared in <fmt/base.h>
template<typename Char = char>
struct runtime_format_string;


Data Members

Name
str

Non-Member Functions

Name Description
runtimeCreates a runtime format string.

Synopsis

Declared in <fmt/base.h>
basic_string_view<Char> str;


Synopsis

Declared in <fmt/compile.h>
template<size_t N>
class static_format_result;


Member Functions

Name
static_format_result [constructor]
c_str
str

Synopsis

Declared in <fmt/compile.h>
template<
    typename S,
    typename... T>
constexpr
explicit
static_format_result(
    S const& fmt,
    T...&&... args);


Synopsis

Declared in <fmt/compile.h>
char const*
c_str() const;


Synopsis

Declared in <fmt/compile.h>
fmt::string_view
str() const;


Synopsis

Declared in <fmt/format.h>
class string_buffer;


Member Functions

Name Description
string_buffer [constructor]Default constructor
str
operator writer Conversion to writer
Default constructor

Synopsis

Declared in <fmt/format.h>
string_buffer();


Synopsis

Declared in <fmt/format.h>
std::string&
str();


Conversion to writer

Synopsis

Declared in <fmt/format.h>
operator writer();


Return Value

The object converted to writer
A text style consisting of foreground and background colors and emphasis.

Synopsis

Declared in <fmt/color.h>
class text_style;


Member Functions

Name Description
text_style [constructor]Construct from emphasis
get_background
get_emphasis
get_foreground
has_background
has_emphasis
has_foreground
operator|= Bitwise disjunction assignment operator
operator== Equality operator
operator!= Inequality operator

Friends

|===
Name Description
bg Creates a text style from the background color.
fg Creates a text style from the foreground (text) color.
operator| Bitwise disjunction operator

Non-Member Functions

Name Description
formatFormats arguments and returns the result as a string using ANSI escape sequences to specify text formatting.
printFormats a string and prints it to stdout using ANSI escape sequences to specify text formatting.
Construct from emphasis

Synopsis

Declared in <fmt/color.h>
constexpr
text_style(emphasis em = emphasis()) noexcept;


Parameters

Name Description
em The object to construct from

Synopsis

Declared in <fmt/color.h>
constexpr
/* implementation-defined */
get_background() const noexcept;


Synopsis

Declared in <fmt/color.h>
constexpr
emphasis
get_emphasis() const noexcept;


Synopsis

Declared in <fmt/color.h>
constexpr
/* implementation-defined */
get_foreground() const noexcept;


Synopsis

Declared in <fmt/color.h>
constexpr
bool
has_background() const noexcept;


Synopsis

Declared in <fmt/color.h>
constexpr
bool
has_emphasis() const noexcept;


Synopsis

Declared in <fmt/color.h>
constexpr
bool
has_foreground() const noexcept;


Bitwise disjunction assignment operator

Synopsis

Declared in <fmt/color.h>
constexpr
text_style&
operator|=(text_style rhs);


Return Value

Reference to the current object

Parameters

Name Description
rhs The right operand
Equality operator

Synopsis

Declared in <fmt/color.h>
constexpr
bool
operator==(text_style rhs) const noexcept;


Return Value

true if the objects are equal, false otherwise

Parameters

Name Description
rhs The right operand
Inequality operator

Synopsis

Declared in <fmt/color.h>
constexpr
bool
operator!=(text_style rhs) const noexcept;


Return Value

true if the objects are not equal, false otherwise

Parameters

Name Description
rhs The right operand

Synopsis

Declared in <fmt/ranges.h>
template<
    typename Tuple,
    typename Char>
struct tuple_join_view
    : /* implementation-defined */


Base Classes

Name Description
/* implementation-defined */

Member Functions

Name Description
tuple_join_view [constructor]Constructor

Data Members

Name
sep
tuple

Non-Member Functions

Name Description
joinReturns an object that formats std::tuple with elements separated by sep.
Constructor

Synopsis

Declared in <fmt/ranges.h>
tuple_join_view(
    Tuple const& t,
    basic_string_view<Char> s);


Parameters

Name Description
t The object to copy construct from
s An implementation of std::basic_string_view for pre-C++17. It provides a subset of the API. fmt::basic_string_view is used for format strings even if std::basic_string_view is available to prevent issues when a library is compiled with a different -std option than the client code (which is not recommended).

Synopsis

Declared in <fmt/ranges.h>
basic_string_view<Char> sep;


Synopsis

Declared in <fmt/ranges.h>
Tuple const& tuple;


Synopsis

Declared in <fmt/printf.h>
template<typename Char>
struct vprintf_args;


Types

Name
type

Synopsis

Declared in <fmt/printf.h>
using type = basic_format_args<basic_printf_context<Char>>;


Synopsis

Declared in <fmt/chrono.h>
class weekday;


Member Functions

Name Description
weekday [constructor]Constructors
c_encoding
Constructors

Synopses

Declared in <fmt/chrono.h>
Default constructor
constexpr
weekday() = default;


» more... Construct from unsigned int
constexpr
explicit
weekday(unsigned int wd) noexcept;


» more...
Default constructor

Synopsis

Declared in <fmt/chrono.h>
constexpr
weekday() = default;


Construct from unsigned int

Synopsis

Declared in <fmt/chrono.h>
constexpr
explicit
weekday(unsigned int wd) noexcept;


Parameters

Name Description
wd The value to construct from

Synopsis

Declared in <fmt/chrono.h>
constexpr
unsigned int
c_encoding() const noexcept;


Synopsis

Declared in <fmt/format.h>
class writer;


Member Functions

Name Description
writer [constructor]Constructors
print Formats args according to specifications in fmt and writes the output to the file.
Constructors

Synopses

Declared in <fmt/format.h>
Construct from buffer
writer(/* implementation-defined */& buf);


» more... Construct from FILE
writer(FILE* f);


» more...
Construct from buffer

Synopsis

Declared in <fmt/format.h>
writer(/* implementation-defined */& buf);


Parameters

Name Description
buf The object to copy construct from
Construct from FILE

Synopsis

Declared in <fmt/format.h>
writer(FILE* f);


Parameters

Name Description
f The object to construct from
Formats args according to specifications in fmt and writes the output to the file.

Synopsis

Declared in <fmt/format.h>
template<typename... T>
void
print(
    format_string<T...> fmt,
    T...&&... args);


Synopsis

Declared in <fmt/chrono.h>
class year;


Member Functions

Name Description
year [constructor]Constructors
operator int Conversion to int
Constructors

Synopses

Declared in <fmt/chrono.h>
Default constructor
constexpr
year() = default;


» more... Construct from int
constexpr
explicit
year(int y) noexcept;


» more...
Default constructor

Synopsis

Declared in <fmt/chrono.h>
constexpr
year() = default;


Construct from int

Synopsis

Declared in <fmt/chrono.h>
constexpr
explicit
year(int y) noexcept;


Parameters

Name Description
y The value to construct from
Conversion to int

Synopsis

Declared in <fmt/chrono.h>
constexpr
explicit
operator int() const noexcept;


Return Value

The object converted to int

Synopsis

Declared in <fmt/chrono.h>
class year_month_day;


Member Functions

Name Description
year_month_day [constructor]Constructors
day
month
year
Constructors

Synopses

Declared in <fmt/chrono.h>
Default constructor
constexpr
year_month_day() = default;


» more...
constexpr
year_month_day(
    year const& y,
    month const& m,
    day const& d) noexcept;


» more...
Default constructor

Synopsis

Declared in <fmt/chrono.h>
constexpr
year_month_day() = default;


Synopsis

Declared in <fmt/chrono.h>
constexpr
year_month_day(
    year const& y,
    month const& m,
    day const& d) noexcept;


Synopsis

Declared in <fmt/chrono.h>
constexpr
fmt::day
day() const noexcept;


Synopsis

Declared in <fmt/chrono.h>
constexpr
fmt::month
month() const noexcept;


Synopsis

Declared in <fmt/chrono.h>
constexpr
fmt::year
year() const noexcept;


Synopsis

Declared in <fmt/format.h>
enum Unnamed enum;


Members

Name Description
inline_buffer_size

Synopsis

Declared in <fmt/base.h>
enum class align : int;


Members

Name Description
none
left
right
center
numeric

Synopsis

Declared in <fmt/base.h>
enum class arg_id_kind : int;


Members

Name Description
none
index
name

Synopsis

Declared in <fmt/color.h>
enum class color : uint32_t;


Members

Name Description
alice_blue
antique_white
aqua
aquamarine
azure
beige
bisque
black
blanched_almond
blue
blue_violet
brown
burly_wood
cadet_blue
chartreuse
chocolate
coral
cornflower_blue
cornsilk
crimson
cyan
dark_blue
dark_cyan
dark_golden_rod
dark_gray
dark_green
dark_khaki
dark_magenta
dark_olive_green
dark_orange
dark_orchid
dark_red
dark_salmon
dark_sea_green
dark_slate_blue
dark_slate_gray
dark_turquoise
dark_violet
deep_pink
deep_sky_blue
dim_gray
dodger_blue
fire_brick
floral_white
forest_green
fuchsia
gainsboro
ghost_white
gold
golden_rod
gray
green
green_yellow
honey_dew
hot_pink
indian_red
indigo
ivory
khaki
lavender
lavender_blush
lawn_green
lemon_chiffon
light_blue
light_coral
light_cyan
light_golden_rod_yellow
light_gray
light_green
light_pink
light_salmon
light_sea_green
light_sky_blue
light_slate_gray
light_steel_blue
light_yellow
lime
lime_green
linen
magenta
maroon
medium_aquamarine
medium_blue
medium_orchid
medium_purple
medium_sea_green
medium_slate_blue
medium_spring_green
medium_turquoise
medium_violet_red
midnight_blue
mint_cream
misty_rose
moccasin
navajo_white
navy
old_lace
olive
olive_drab
orange
orange_red
orchid
pale_golden_rod
pale_green
pale_turquoise
pale_violet_red
papaya_whip
peach_puff
peru
pink
plum
powder_blue
purple
rebecca_purple
red
rosy_brown
royal_blue
saddle_brown
salmon
sandy_brown
sea_green
sea_shell
sienna
silver
sky_blue
slate_blue
slate_gray
snow
spring_green
steel_blue
tan
teal
thistle
tomato
turquoise
violet
wheat
white
white_smoke
yellow
yellow_green

Synopsis

Declared in <fmt/color.h>
enum class emphasis : uint8_t;


Members

Name Description
bold
faint
italic
underline
blink
reverse
conceal
strikethrough

Synopsis

Declared in <fmt/base.h>
enum class presentation_type : unsigned char;


Members

Name Description
none
debug
string
dec
hex
oct
bin
chr
pointer
exp
fixed
general
hexfloat

Synopsis

Declared in <fmt/ranges.h>
enum class range_format : int;


Members

Name Description
disabled
map
set
sequence
string
debug_string

Synopsis

Declared in <fmt/base.h>
enum class sign : int;


Members

Name Description
none
minus
plus
space

Synopsis

Declared in <fmt/color.h>
enum class terminal_color : uint8_t;


Members

Name Description
black
red
green
yellow
blue
magenta
cyan
white
bright_black
bright_red
bright_green
bright_yellow
bright_blue
bright_magenta
bright_cyan
bright_white

Synopses

Declared in <fmt/compile.h>
template</* implementation-defined */ S>
constexpr
auto
Unnamed function();


» more...
template</* implementation-defined */ Str>
constexpr
auto
Unnamed function();


» more...

Synopsis

Declared in <fmt/format.h>
template</* implementation-defined */ S>
constexpr
auto
Unnamed function();


Synopsis

Declared in <fmt/compile.h>
template</* implementation-defined */ Str>
constexpr
auto
Unnamed function();


Returns a named argument to be used in a formatting function. It should only be used in a call to a formatting function.

Synopsis

Declared in <fmt/base.h>
template<
    typename Char,
    typename T>
/* implementation-defined */
arg(
    Char const* name,
    T const& arg);


Description

*Example:

fmt::print("The answer is {answer}.", fmt::arg("answer", 42));

Return Value

a named argument to be used in a formatting function. It should only be used in a call to a formatting function.

Synopsis

Declared in <fmt/base.h>
[[noreturn]]
void
assert_fail(
    char const* file,
    int line,
    char const* message);


Creates a text style from the background color.

Synopsis

Declared in <fmt/color.h>
constexpr
text_style
bg(/* implementation-defined */ background) noexcept;


Return Value

A text style consisting of foreground and background colors and emphasis.
Creates a text style from the foreground (text) color.

Synopsis

Declared in <fmt/color.h>
constexpr
text_style
fg(/* implementation-defined */ foreground) noexcept;


Return Value

A text style consisting of foreground and background colors and emphasis.
format overloads

Synopses

Declared in <fmt/color.h>
Formats args according to specifications in fmt and returns the result as a string.
template<typename... T>
[[nodiscard, always_inline]]
std::string
format(
    format_string<T...> fmt,
    T...&&... args);


» more...
template<typename... T>
std::wstring
format(
    wformat_string<T...> fmt,
    T...&&... args);


» more...
template<
    typename S,
    typename... T>
[[always_inline]]
constexpr
std::basic_string<S::char_type>
format(
    S const&,
    T...&&... args);


» more...
template<
    typename CompiledFormat,
    typename... T,
    typename Char = CompiledFormat::char_type>
[[always_inline]]
constexpr
std::basic_string<Char>
format(
    CompiledFormat const& cf,
    T const...&... args);


» more...
template<
    typename S,
    typename... T,
    typename Char = /* implementation-defined */>
std::basic_string<Char>
format(
    S const& fmt,
    T...&&... args);


» more...
template<typename... T>
[[always_inline]]
std::string
format(
    locale_ref loc,
    format_string<T...> fmt,
    T...&&... args);


» more... Formats arguments and returns the result as a string using ANSI escape sequences to specify text formatting.
template<typename... T>
std::string
format(
    text_style ts,
    format_string<T...> fmt,
    T...&&... args);


» more...
template<typename... T>
std::wstring
format(
    text_style ts,
    wformat_string<T...> fmt,
    T...&&... args);


» more...
template<
    typename S,
    typename... T,
    typename Char = /* implementation-defined */>
std::basic_string<Char>
format(
    locale_ref loc,
    S const& fmt,
    T...&&... args);


» more...
Formats args according to specifications in fmt and returns the result as a string.

Synopsis

Declared in <fmt/format.h>
template<typename... T>
[[nodiscard, always_inline]]
std::string
format(
    format_string<T...> fmt,
    T...&&... args);


Description

*Example:

#include <fmt/format.h> std::string message = fmt::format("The answer is {}.", 42);

Synopsis

Declared in <fmt/xchar.h>
template<typename... T>
std::wstring
format(
    wformat_string<T...> fmt,
    T...&&... args);


Synopsis

Declared in <fmt/compile.h>
template<
    typename S,
    typename... T>
[[always_inline]]
constexpr
std::basic_string<S::char_type>
format(
    S const&,
    T...&&... args);


Synopsis

Declared in <fmt/compile.h>
template<
    typename CompiledFormat,
    typename... T,
    typename Char = CompiledFormat::char_type>
[[always_inline]]
constexpr
std::basic_string<Char>
format(
    CompiledFormat const& cf,
    T const...&... args);


Synopsis

Declared in <fmt/xchar.h>
template<
    typename S,
    typename... T,
    typename Char = /* implementation-defined */>
std::basic_string<Char>
format(
    S const& fmt,
    T...&&... args);


Synopsis

Declared in <fmt/format.h>
template<typename... T>
[[always_inline]]
std::string
format(
    locale_ref loc,
    format_string<T...> fmt,
    T...&&... args);


Formats arguments and returns the result as a string using ANSI escape sequences to specify text formatting.

Synopsis

Declared in <fmt/color.h>
template<typename... T>
std::string
format(
    text_style ts,
    format_string<T...> fmt,
    T...&&... args);


Description

*Example:

#include <fmt/color.h> std::string message = fmt::format(fmt::emphasis::bold | fg(fmt::color::red), "The answer is {}", 42);

Parameters

Name Description
ts A text style consisting of foreground and background colors and emphasis.

Synopsis

Declared in <fmt/xchar.h>
template<typename... T>
std::wstring
format(
    text_style ts,
    wformat_string<T...> fmt,
    T...&&... args);


Synopsis

Declared in <fmt/xchar.h>
template<
    typename S,
    typename... T,
    typename Char = /* implementation-defined */>
std::basic_string<Char>
format(
    locale_ref loc,
    S const& fmt,
    T...&&... args);


Formats an error message for an error returned by an operating system or a language runtime, for example a file opening error, and writes it to out. The format is the same as the one used by std::system_error(ec, message) where ec is std::error_code(error_code, std::generic_category()). It is implementation-defined but normally looks like:

Synopsis

Declared in <fmt/format.h>
void
format_system_error(
    /* implementation-defined */& out,
    int error_code,
    char const* message) noexcept;


Description

<message>: <system-message>

where <message> is the passed message and <system-message> is the system message corresponding to the error code. error_code is a system error code as given by errno.

Parameters

Name Description
out A contiguous memory buffer with an optional growing ability. It is an internal class and shouldn't be used directly, only via memory_buffer.
format_to overloads

Synopses

Declared in <fmt/base.h>
template<
    typename OutputIt,
    typename... T>
OutputIt
format_to(
    OutputIt out,
    wformat_string<T...> fmt,
    T...&&... args);


» more...
template<
    size_t N,
    typename... T>
[[always_inline]]
format_to_result
format_to(
    char(& out)[],
    format_string<T...> fmt,
    T...&&... args);


» more... Formats args according to specifications in fmt, writes the result to the output iterator out and returns the iterator past the end of the output range. format_to does not append a terminating null character.
template<
    typename OutputIt,
    typename... T>
[[always_inline]]
remove_cvref_t<OutputIt>
format_to(
    OutputIt&& out,
    format_string<T...> fmt,
    T...&&... args);


» more...
template<
    typename OutputIt,
    typename CompiledFormat,
    typename... T>
[[always_inline]]
constexpr
OutputIt
format_to(
    OutputIt out,
    CompiledFormat const& cf,
    T const...&... args);


» more...
template<
    typename OutputIt,
    typename S,
    typename... T>
constexpr
OutputIt
format_to(
    OutputIt out,
    S const&,
    T...&&... args);


» more...
template<
    typename OutputIt,
    typename S,
    typename... T,
    typename Char = /* implementation-defined */>
OutputIt
format_to(
    OutputIt out,
    S const& fmt,
    T...&&... args);


» more...
template<
    typename OutputIt,
    typename... T>
[[always_inline]]
OutputIt
format_to(
    OutputIt out,
    locale_ref loc,
    format_string<T...> fmt,
    T...&&... args);


» more... Formats arguments with the given text style, writes the result to the output iterator out and returns the iterator past the end of the output range.
template<
    typename OutputIt,
    typename... T>
OutputIt
format_to(
    OutputIt out,
    text_style ts,
    format_string<T...> fmt,
    T...&&... args);


» more...
template<
    typename OutputIt,
    typename S,
    typename... T,
    typename Char = /* implementation-defined */,
    bool enable = detail::is_output_iterator<OutputIt, Char>::value && detail::is_exotic_char<Char>::value>
OutputIt
format_to(
    OutputIt out,
    locale_ref loc,
    S const& fmt,
    T...&&... args)
requires enable;


» more...

Synopsis

Declared in <fmt/xchar.h>
template<
    typename OutputIt,
    typename... T>
OutputIt
format_to(
    OutputIt out,
    wformat_string<T...> fmt,
    T...&&... args);


Synopsis

Declared in <fmt/base.h>
template<
    size_t N,
    typename... T>
[[always_inline]]
format_to_result
format_to(
    char(& out)[],
    format_string<T...> fmt,
    T...&&... args);


Formats args according to specifications in fmt, writes the result to the output iterator out and returns the iterator past the end of the output range. format_to does not append a terminating null character.

Synopsis

Declared in <fmt/base.h>
template<
    typename OutputIt,
    typename... T>
[[always_inline]]
remove_cvref_t<OutputIt>
format_to(
    OutputIt&& out,
    format_string<T...> fmt,
    T...&&... args);


Description

*Example:

auto out = std::vector<char>(); fmt::format_to(std::back_inserter(out), "{}", 42);

Synopsis

Declared in <fmt/compile.h>
template<
    typename OutputIt,
    typename CompiledFormat,
    typename... T>
[[always_inline]]
constexpr
OutputIt
format_to(
    OutputIt out,
    CompiledFormat const& cf,
    T const...&... args);


Synopsis

Declared in <fmt/compile.h>
template<
    typename OutputIt,
    typename S,
    typename... T>
constexpr
OutputIt
format_to(
    OutputIt out,
    S const&,
    T...&&... args);


Synopsis

Declared in <fmt/xchar.h>
template<
    typename OutputIt,
    typename S,
    typename... T,
    typename Char = /* implementation-defined */>
OutputIt
format_to(
    OutputIt out,
    S const& fmt,
    T...&&... args);


Synopsis

Declared in <fmt/format.h>
template<
    typename OutputIt,
    typename... T>
[[always_inline]]
OutputIt
format_to(
    OutputIt out,
    locale_ref loc,
    format_string<T...> fmt,
    T...&&... args);


Formats arguments with the given text style, writes the result to the output iterator out and returns the iterator past the end of the output range.

Synopsis

Declared in <fmt/color.h>
template<
    typename OutputIt,
    typename... T>
OutputIt
format_to(
    OutputIt out,
    text_style ts,
    format_string<T...> fmt,
    T...&&... args);


Description

*Example:

std::vector<char> out; fmt::format_to(std::back_inserter(out), fmt::emphasis::bold | fg(fmt::color::red), "{}", 42);

Parameters

Name Description
ts A text style consisting of foreground and background colors and emphasis.

Synopsis

Declared in <fmt/xchar.h>
template<
    typename OutputIt,
    typename S,
    typename... T,
    typename Char = /* implementation-defined */,
    bool enable = detail::is_output_iterator<OutputIt, Char>::value && detail::is_exotic_char<Char>::value>
OutputIt
format_to(
    OutputIt out,
    locale_ref loc,
    S const& fmt,
    T...&&... args)
requires enable;


Formats args according to specifications in fmt, writes up to n characters of the result to the output iterator out and returns the total (not truncated) output size and the iterator past the end of the output range. format_to_n does not append a terminating null character.

Synopses

Declared in <fmt/base.h>
Formats args according to specifications in fmt, writes up to n characters of the result to the output iterator out and returns the total (not truncated) output size and the iterator past the end of the output range. format_to_n does not append a terminating null character.
template<
    typename OutputIt,
    typename... T>
[[always_inline]]
format_to_n_result<OutputIt>
format_to_n(
    OutputIt out,
    size_t n,
    format_string<T...> fmt,
    T...&&... args);


» more...
template<
    typename OutputIt,
    typename S,
    typename... T>
format_to_n_result<OutputIt>
format_to_n(
    OutputIt out,
    size_t n,
    S const& fmt,
    T...&&... args);


» more...
template<
    typename OutputIt,
    typename S,
    typename... T,
    typename Char = /* implementation-defined */>
format_to_n_result<OutputIt>
format_to_n(
    OutputIt out,
    size_t n,
    S const& fmt,
    T...&&... args);


» more...
Formats args according to specifications in fmt, writes up to n characters of the result to the output iterator out and returns the total (not truncated) output size and the iterator past the end of the output range. format_to_n does not append a terminating null character.

Synopsis

Declared in <fmt/base.h>
template<
    typename OutputIt,
    typename... T>
[[always_inline]]
format_to_n_result<OutputIt>
format_to_n(
    OutputIt out,
    size_t n,
    format_string<T...> fmt,
    T...&&... args);


Synopsis

Declared in <fmt/compile.h>
template<
    typename OutputIt,
    typename S,
    typename... T>
format_to_n_result<OutputIt>
format_to_n(
    OutputIt out,
    size_t n,
    S const& fmt,
    T...&&... args);


Synopsis

Declared in <fmt/xchar.h>
template<
    typename OutputIt,
    typename S,
    typename... T,
    typename Char = /* implementation-defined */>
format_to_n_result<OutputIt>
format_to_n(
    OutputIt out,
    size_t n,
    S const& fmt,
    T...&&... args);


Returns the number of chars in the output of format(fmt, args...).

Synopses

Declared in <fmt/base.h>
Returns the number of chars in the output of format(fmt, args...).
template<typename... T>
[[nodiscard, always_inline]]
size_t
formatted_size(
    format_string<T...> fmt,
    T...&&... args);


» more...
template<
    typename S,
    typename... T>
constexpr
size_t
formatted_size(
    S const& fmt,
    T...&&... args);


» more...
template<
    typename S,
    typename... T,
    typename Char = /* implementation-defined */>
size_t
formatted_size(
    S const& fmt,
    T...&&... args);


» more...
template<typename... T>
[[nodiscard, always_inline]]
size_t
formatted_size(
    locale_ref loc,
    format_string<T...> fmt,
    T...&&... args);


» more...
Returns the number of chars in the output of format(fmt, args...).

Synopsis

Declared in <fmt/base.h>
template<typename... T>
[[nodiscard, always_inline]]
size_t
formatted_size(
    format_string<T...> fmt,
    T...&&... args);


Synopsis

Declared in <fmt/compile.h>
template<
    typename S,
    typename... T>
constexpr
size_t
formatted_size(
    S const& fmt,
    T...&&... args);


Synopsis

Declared in <fmt/xchar.h>
template<
    typename S,
    typename... T,
    typename Char = /* implementation-defined */>
size_t
formatted_size(
    S const& fmt,
    T...&&... args);


Synopsis

Declared in <fmt/format.h>
template<typename... T>
[[nodiscard, always_inline]]
size_t
formatted_size(
    locale_ref loc,
    format_string<T...> fmt,
    T...&&... args);


Formats args according to specifications in fmt and writes the output to f.

Synopsis

Declared in <fmt/printf.h>
template<
    typename S,
    typename... T,
    typename Char = /* implementation-defined */>
int
fprintf(
    FILE* f,
    S const& fmt,
    T const...&... args);


Description

*Example:

fmt::fprintf(stderr, "Don't %s!", "panic");

Converts given time since epoch as std::time_t value into calendar time, expressed in Coordinated Universal Time (UTC). Unlike std::gmtime, this function is thread-safe on most platforms.

Synopses

Declared in <fmt/chrono.h>
Converts given time since epoch as std::time_t value into calendar time, expressed in Coordinated Universal Time (UTC). Unlike std::gmtime, this function is thread-safe on most platforms.
tm
gmtime(time_t time);


» more...
template<typename Duration>
tm
gmtime(sys_time<Duration> time_point);


» more...
Converts given time since epoch as std::time_t value into calendar time, expressed in Coordinated Universal Time (UTC). Unlike std::gmtime, this function is thread-safe on most platforms.

Synopsis

Declared in <fmt/chrono.h>
tm
gmtime(time_t time);


Synopsis

Declared in <fmt/chrono.h>
template<typename Duration>
tm
gmtime(sys_time<Duration> time_point);


Returns a view that formats an integer value using ',' as a locale-independent thousands separator.

Synopsis

Declared in <fmt/format.h>
template<typename T>
group_digits_view<T>
group_digits(T value);


Description

*Example:

fmt::print("{}", fmt::group_digits(12345)); // Output: "12,345"

Return Value

a view that formats an integer value using ',' as a locale-independent thousands separator.
join overloads

Synopses

Declared in <fmt/ranges.h>
Returns an object that formats std::initializer_list with elements separated by sep.
template<typename T>
join_view<T const*, T const*>
join(
    std::initializer_list<T> list,
    string_view sep);


» more...
template<typename T>
join_view<T const*, T const*, wchar_t>
join(
    std::initializer_list<T> list,
    wstring_view sep);


» more... Returns an object that formats std::tuple with elements separated by sep.
template<typename Tuple>
constexpr
tuple_join_view<Tuple, char>
join(
    Tuple const& tuple,
    string_view sep);


» more...
template<typename Tuple>
tuple_join_view<Tuple, wchar_t>
join(
    Tuple const& tuple,
    basic_string_view<wchar_t> sep);


» more... Returns a view that formats range with elements separated by sep.
template<typename Range>
join_view<decltype(detail::range_begin(r)), decltype(detail::range_end(r))>
join(
    Range&& r,
    string_view sep);


» more...
template<typename Range>
join_view<decltype(std::begin(range)), decltype(std::end(range)), wchar_t>
join(
    Range&& range,
    wstring_view sep);


» more... Returns a view that formats the iterator range [begin, end) with elements separated by sep.
template<
    typename It,
    typename Sentinel>
join_view<It, Sentinel>
join(
    It begin,
    Sentinel end,
    string_view sep);


» more...
template<
    typename It,
    typename Sentinel>
join_view<It, Sentinel, wchar_t>
join(
    It begin,
    Sentinel end,
    wstring_view sep);


» more...
Returns an object that formats std::initializer_list with elements separated by sep.

Synopsis

Declared in <fmt/ranges.h>
template<typename T>
join_view<T const*, T const*>
join(
    std::initializer_list<T> list,
    string_view sep);


Description

*Example:

fmt::print("{}", fmt::join({1, 2, 3}, ", ")); // Output: "1, 2, 3"

Synopsis

Declared in <fmt/xchar.h>
template<typename T>
join_view<T const*, T const*, wchar_t>
join(
    std::initializer_list<T> list,
    wstring_view sep);


Returns an object that formats std::tuple with elements separated by sep.

Synopsis

Declared in <fmt/ranges.h>
template<typename Tuple>
constexpr
tuple_join_view<Tuple, char>
join(
    Tuple const& tuple,
    string_view sep);


Description

*Example:

auto t = std::tuple<int, char>{1, 'a'}; fmt::print("{}", fmt::join(t, ", ")); // Output: 1, a

Synopsis

Declared in <fmt/xchar.h>
template<typename Tuple>
tuple_join_view<Tuple, wchar_t>
join(
    Tuple const& tuple,
    basic_string_view<wchar_t> sep);


Returns a view that formats range with elements separated by sep.

Synopsis

Declared in <fmt/ranges.h>
template<typename Range>
join_view<decltype(detail::range_begin(r)), decltype(detail::range_end(r))>
join(
    Range&& r,
    string_view sep);


Description

*Example:

auto v = std::vector<int>{1, 2, 3}; fmt::print("{}", fmt::join(v, ", ")); // Output: 1, 2, 3

fmt::join applies passed format specifiers to the range elements:

fmt::print("{:02}", fmt::join(v, ", ")); // Output: 01, 02, 03

Synopsis

Declared in <fmt/xchar.h>
template<typename Range>
join_view<decltype(std::begin(range)), decltype(std::end(range)), wchar_t>
join(
    Range&& range,
    wstring_view sep);


Returns a view that formats the iterator range [begin, end) with elements separated by sep.

Synopsis

Declared in <fmt/ranges.h>
template<
    typename It,
    typename Sentinel>
join_view<It, Sentinel>
join(
    It begin,
    Sentinel end,
    string_view sep);


Synopsis

Declared in <fmt/xchar.h>
template<
    typename It,
    typename Sentinel>
join_view<It, Sentinel, wchar_t>
join(
    It begin,
    Sentinel end,
    wstring_view sep);


Converts given time since epoch as std::time_t value into calendar time, expressed in local time. Unlike std::localtime, this function is thread-safe on most platforms.

Synopsis

Declared in <fmt/chrono.h>
[[deprecated]]
tm
localtime(time_t time);


Synopsis

Declared in <fmt/base.h>
template<
    typename Context = context,
    typename... T,
    int NUM_ARGS = sizeof...(T),
    int NUM_NAMED_ARGS = detail::count_named_args<T...>(),
    unsigned long long DESC = detail::make_descriptor<Context, T...>()>
[[always_inline]]
constexpr
/* implementation-defined */
make_format_args(T...&... args);


Constructs an format_arg_store object that contains references to arguments and can be implicitly converted to printf_args.

Synopsis

Declared in <fmt/printf.h>
template<
    typename Char = char,
    typename... T>
decltype(fmt::make_format_args<basic_printf_context<Char>>(args...))
make_printf_args(T...&... args);


Synopsis

Declared in <fmt/xchar.h>
template<typename... T>
constexpr
decltype(fmt::make_format_args<wformat_context>(args...))
make_wformat_args(T...&... args);


Synopsis

Declared in <fmt/base.h>
template<typename T>
constexpr
T
max_of(
    T a,
    T b);


Synopsis

Declared in <fmt/base.h>
template<typename T>
constexpr
T
min_of(
    T a,
    T b);


Bitwise disjunction operators

Synopses

Declared in <fmt/color.h>
Bitwise disjunction operator
constexpr
text_style
operator|(
    emphasis lhs,
    emphasis rhs) noexcept;


» more... Bitwise disjunction operator
constexpr
text_style
operator|(
    text_style lhs,
    text_style rhs);


» more...
Bitwise disjunction operator

Synopsis

Declared in <fmt/color.h>
constexpr
text_style
operator|(
    emphasis lhs,
    emphasis rhs) noexcept;


Return Value

A text style consisting of foreground and background colors and emphasis.

Parameters

Name Description
lhs The left operand
rhs The right operand
Bitwise disjunction operator

Synopsis

Declared in <fmt/color.h>
constexpr
text_style
operator|(
    text_style lhs,
    text_style rhs);


Return Value

A text style consisting of foreground and background colors and emphasis.

Parameters

Name Description
lhs The left operand
rhs The right operand
print overloads

Synopses

Declared in <fmt/base.h>
Formats args according to specifications in fmt and writes the output to stdout.
template<typename... T>
[[always_inline]]
void
print(
    format_string<T...> fmt,
    T...&&... args);


» more...
template<typename... T>
void
print(
    wformat_string<T...> fmt,
    T...&&... args);


» more...
template<
    typename S,
    typename... T>
void
print(
    S const& fmt,
    T...&&... args);


» more... Formats a string and prints it to stdout using ANSI escape sequences to specify text formatting.
template<typename... T>
void
print(
    text_style ts,
    format_string<T...> fmt,
    T...&&... args);


» more...
template<typename... T>
[[deprecated]]
void
print(
    text_style ts,
    wformat_string<T...> fmt,
    T const...&... args);


» more... Prints formatted data to the stream os.
template<typename... T>
void
print(
    std::ostream& os,
    format_string<T...> fmt,
    T...&&... args);


» more...
template<typename... T>
void
print(
    std::wostream& os,
    wformat_string<T...> fmt,
    T...&&... args);


» more... Formats args according to specifications in fmt and writes the output to the file f.
template<typename... T>
[[always_inline]]
void
print(
    FILE* f,
    format_string<T...> fmt,
    T...&&... args);


» more...
template<typename... T>
void
print(
    FILE* f,
    wformat_string<T...> fmt,
    T...&&... args);


» more...
template<
    typename S,
    typename... T>
void
print(
    FILE* f,
    S const& fmt,
    T...&&... args);


» more... Formats a string and prints it to the specified file stream using ANSI escape sequences to specify text formatting.
template<typename... T>
void
print(
    FILE* f,
    text_style ts,
    format_string<T...> fmt,
    T...&&... args);


» more...
template<typename... T>
[[deprecated]]
void
print(
    FILE* f,
    text_style ts,
    wformat_string<T...> fmt,
    T const...&... args);


» more...
Formats args according to specifications in fmt and writes the output to stdout.

Synopsis

Declared in <fmt/base.h>
template<typename... T>
[[always_inline]]
void
print(
    format_string<T...> fmt,
    T...&&... args);


Description

*Example:

fmt::print("The answer is {}.", 42);

Synopsis

Declared in <fmt/xchar.h>
template<typename... T>
void
print(
    wformat_string<T...> fmt,
    T...&&... args);


Synopsis

Declared in <fmt/compile.h>
template<
    typename S,
    typename... T>
void
print(
    S const& fmt,
    T...&&... args);


Formats a string and prints it to stdout using ANSI escape sequences to specify text formatting.

Synopsis

Declared in <fmt/color.h>
template<typename... T>
void
print(
    text_style ts,
    format_string<T...> fmt,
    T...&&... args);


Description

*Example:

fmt::print(fmt::emphasis::bold | fg(fmt::color::red), "Elapsed time: {0:.2f} seconds", 1.23);

Parameters

Name Description
ts A text style consisting of foreground and background colors and emphasis.

Synopsis

Declared in <fmt/xchar.h>
template<typename... T>
[[deprecated]]
void
print(
    text_style ts,
    wformat_string<T...> fmt,
    T const...&... args);


Prints formatted data to the stream os.

Synopsis

Declared in <fmt/ostream.h>
template<typename... T>
void
print(
    std::ostream& os,
    format_string<T...> fmt,
    T...&&... args);


Description

*Example:

fmt::print(cerr, "Don't {}!", "panic");

Synopsis

Declared in <fmt/xchar.h>
template<typename... T>
void
print(
    std::wostream& os,
    wformat_string<T...> fmt,
    T...&&... args);


Formats args according to specifications in fmt and writes the output to the file f.

Synopsis

Declared in <fmt/base.h>
template<typename... T>
[[always_inline]]
void
print(
    FILE* f,
    format_string<T...> fmt,
    T...&&... args);


Description

*Example:

fmt::print(stderr, "Don't {}!", "panic");

Synopsis

Declared in <fmt/xchar.h>
template<typename... T>
void
print(
    FILE* f,
    wformat_string<T...> fmt,
    T...&&... args);


Synopsis

Declared in <fmt/compile.h>
template<
    typename S,
    typename... T>
void
print(
    FILE* f,
    S const& fmt,
    T...&&... args);


Formats a string and prints it to the specified file stream using ANSI escape sequences to specify text formatting.

Synopsis

Declared in <fmt/color.h>
template<typename... T>
void
print(
    FILE* f,
    text_style ts,
    format_string<T...> fmt,
    T...&&... args);


Description

*Example:

fmt::print(fmt::emphasis::bold | fg(fmt::color::red), "Elapsed time: {0:.2f} seconds", 1.23);

Parameters

Name Description
ts A text style consisting of foreground and background colors and emphasis.

Synopsis

Declared in <fmt/xchar.h>
template<typename... T>
[[deprecated]]
void
print(
    FILE* f,
    text_style ts,
    wformat_string<T...> fmt,
    T const...&... args);


Formats args according to specifications in fmt and writes the output to stdout.

Synopses

Declared in <fmt/printf.h>
Formats args according to specifications in fmt and writes the output to stdout.
template<typename... T>
int
printf(
    string_view fmt,
    T const...&... args);


» more...
template<typename... T>
[[deprecated]]
int
printf(
    basic_string_view<wchar_t> fmt,
    T const...&... args);


» more...
Formats args according to specifications in fmt and writes the output to stdout.

Synopsis

Declared in <fmt/printf.h>
template<typename... T>
int
printf(
    string_view fmt,
    T const...&... args);


Description

*Example:

fmt::printf("Elapsed time: %.2f seconds", 1.23);

Synopsis

Declared in <fmt/printf.h>
template<typename... T>
[[deprecated]]
int
printf(
    basic_string_view<wchar_t> fmt,
    T const...&... args);


println overloads

Synopses

Declared in <fmt/base.h>
Formats args according to specifications in fmt and writes the output to stdout followed by a newline.
template<typename... T>
[[always_inline]]
void
println(
    format_string<T...> fmt,
    T...&&... args);


» more...
template<typename... T>
void
println(
    wformat_string<T...> fmt,
    T...&&... args);


» more...
template<typename... T>
void
println(
    std::ostream& os,
    format_string<T...> fmt,
    T...&&... args);


» more...
template<typename... T>
void
println(
    std::wostream& os,
    wformat_string<T...> fmt,
    T...&&... args);


» more... Formats args according to specifications in fmt and writes the output to the file f followed by a newline.
template<typename... T>
[[always_inline]]
void
println(
    FILE* f,
    format_string<T...> fmt,
    T...&&... args);


» more...
template<typename... T>
void
println(
    FILE* f,
    wformat_string<T...> fmt,
    T...&&... args);


» more...
Formats args according to specifications in fmt and writes the output to stdout followed by a newline.

Synopsis

Declared in <fmt/base.h>
template<typename... T>
[[always_inline]]
void
println(
    format_string<T...> fmt,
    T...&&... args);


Synopsis

Declared in <fmt/xchar.h>
template<typename... T>
void
println(
    wformat_string<T...> fmt,
    T...&&... args);


Synopsis

Declared in <fmt/ostream.h>
template<typename... T>
void
println(
    std::ostream& os,
    format_string<T...> fmt,
    T...&&... args);


Synopsis

Declared in <fmt/xchar.h>
template<typename... T>
void
println(
    std::wostream& os,
    wformat_string<T...> fmt,
    T...&&... args);


Formats args according to specifications in fmt and writes the output to the file f followed by a newline.

Synopsis

Declared in <fmt/base.h>
template<typename... T>
[[always_inline]]
void
println(
    FILE* f,
    format_string<T...> fmt,
    T...&&... args);


Synopsis

Declared in <fmt/xchar.h>
template<typename... T>
void
println(
    FILE* f,
    wformat_string<T...> fmt,
    T...&&... args);


Converts p to const void for pointer formatting.

Synopses

Declared in <fmt/format.h>
Converts p to const void for pointer formatting.
template<typename T>
void const*
ptr(T p);


» more...
template<typename T>
void const*
ptr(std::shared_ptr<T> const& p);


» more...
template<
    typename T,
    typename Deleter>
void const*
ptr(std::unique_ptr<T, Deleter> const& p);


» more...
Converts p to const void for pointer formatting.

Synopsis

Declared in <fmt/format.h>
template<typename T>
void const*
ptr(T p);


Description

*Example:

auto s = fmt::format("{}", fmt::ptr(p));

Synopsis

Declared in <fmt/std.h>
template<typename T>
void const*
ptr(std::shared_ptr<T> const& p);


Synopsis

Declared in <fmt/std.h>
template<
    typename T,
    typename Deleter>
void const*
ptr(std::unique_ptr<T, Deleter> const& p);


Reports a format error at compile time or, via a format_error exception, at runtime.

Synopsis

Declared in <fmt/base.h>
[[noreturn]]
void
report_error(char const* message);


Synopsis

Declared in <fmt/format.h>
void
report_system_error(
    int error_code,
    char const* message) noexcept;


Creates a runtime format string.

Synopses

Declared in <fmt/base.h>
Creates a runtime format string.
runtime_format_string
runtime(string_view s);


» more...
runtime_format_string<wchar_t>
runtime(wstring_view s);


» more...
Creates a runtime format string.

Synopsis

Declared in <fmt/base.h>
runtime_format_string
runtime(string_view s);


Description

*Example:

// Check format string at runtime instead of compile-time. fmt::print(fmt::runtime("{:d}"), "I am not a number");

Synopsis

Declared in <fmt/xchar.h>
runtime_format_string<wchar_t>
runtime(wstring_view s);


Formats args according to specifications in fmt and returns the result as as string.

Synopsis

Declared in <fmt/printf.h>
template<
    typename S,
    typename... T,
    typename Char = /* implementation-defined */>
std::basic_string<Char>
sprintf(
    S const& fmt,
    T const...&... args);


Description

*Example:

std::string message = fmt::sprintf("The answer is %d", 42);

Returns a view that formats value via an ostream operator<<.

Synopsis

Declared in <fmt/ostream.h>
template<typename T>
constexpr
/* implementation-defined */
streamed(T const& value);


Description

*Example:

fmt::print("Current thread id: {}n", fmt::streamed(std::this_thread::get_id()));

Returns an argument that will be formatted using ANSI escape sequences, to be used in a formatting function.

Synopsis

Declared in <fmt/color.h>
template<typename T>
constexpr
/* implementation-defined */
styled(
    T const& value,
    text_style ts);


Description

*Example:

fmt::print("Elapsed time: {0:.2f} seconds", fmt::styled(1.23, fmt::fg(fmt::color::green) | fmt::bg(fmt::color::blue)));

Return Value

an argument that will be formatted using ANSI escape sequences, to be used in a formatting function.

Parameters

Name Description
ts A text style consisting of foreground and background colors and emphasis.

Synopsis

Declared in <fmt/os.h>
std::error_category const&
system_category() noexcept;


Constructs std::system_error with a message formatted with fmt::format(fmt, args...). error_code is a system error code as given by errno.

Synopsis

Declared in <fmt/format.h>
template<typename... T>
std::system_error
system_error(
    int error_code,
    format_string<T...> fmt,
    T...&&... args);


Description

*Example:

// This throws std::system_error with the description // cannot open file 'madeup': No such file or directory // or similar (system message may vary). const char* filename = "madeup"; FILE* file = fopen(filename, "r"); if (!file) throw fmt::system_error(errno, "cannot open file '{}'", filename);

Converts value to std::string using the default format for type T.

Synopses

Declared in <fmt/format.h>
Converts value to std::string using the default format for type T.
template<typename T>
[[nodiscard]]
constexpr
std::string
to_string(T value);


» more...
template<typename T>
[[nodiscard]]
constexpr
std::string
to_string(T const& value);


» more...
template<typename T>
[[nodiscard]]
constexpr
std::string
to_string(T const& value);


» more...
template<size_t SIZE>
[[nodiscard]]
std::string
to_string(basic_memory_buffer<char, SIZE> const& buf);


» more...
Converts value to std::string using the default format for type T.

Synopsis

Declared in <fmt/format.h>
template<typename T>
[[nodiscard]]
constexpr
std::string
to_string(T value);


Description

*Example:

std::string answer = fmt::to_string(42);

Synopsis

Declared in <fmt/format.h>
template<typename T>
[[nodiscard]]
constexpr
std::string
to_string(T const& value);


Synopsis

Declared in <fmt/format.h>
template<typename T>
[[nodiscard]]
constexpr
std::string
to_string(T const& value);


Synopsis

Declared in <fmt/format.h>
template<size_t SIZE>
[[nodiscard]]
std::string
to_string(basic_memory_buffer<char, SIZE> const& buf);


Converts value to std::wstring using the default format for type T.

Synopsis

Declared in <fmt/xchar.h>
template<typename T>
std::wstring
to_wstring(T const& value);


Converts e to the underlying type.

Synopsis

Declared in <fmt/format.h>
template<typename Enum>
constexpr
underlying_t<Enum>
underlying(Enum e) noexcept;


Description

*Example:

enum class color { red, green, blue }; auto s = fmt::format("{}", fmt::underlying(color::red)); // s == "0"

Synopses

Declared in <fmt/format.h>
std::string
vformat(
    string_view fmt,
    format_args args);


» more...
template<typename Char>
std::basic_string<Char>
vformat(
    basic_string_view<Char> fmt,
    basic_format_args<buffered_context<Char>> args);


» more...
std::string
vformat(
    locale_ref loc,
    string_view fmt,
    format_args args);


» more...
std::string
vformat(
    text_style ts,
    string_view fmt,
    format_args args);


» more...
std::wstring
vformat(
    text_style ts,
    wstring_view fmt,
    wformat_args args);


» more...
template<
    typename S,
    typename Char = /* implementation-defined */>
std::basic_string<Char>
vformat(
    locale_ref loc,
    S const& fmt,
    basic_format_args<buffered_context<Char>> args);


» more...

Synopsis

Declared in <fmt/format.h>
std::string
vformat(
    string_view fmt,
    format_args args);


Synopsis

Declared in <fmt/xchar.h>
template<typename Char>
std::basic_string<Char>
vformat(
    basic_string_view<Char> fmt,
    basic_format_args<buffered_context<Char>> args);


Synopsis

Declared in <fmt/format.h>
std::string
vformat(
    locale_ref loc,
    string_view fmt,
    format_args args);


Synopsis

Declared in <fmt/color.h>
std::string
vformat(
    text_style ts,
    string_view fmt,
    format_args args);


Synopsis

Declared in <fmt/xchar.h>
std::wstring
vformat(
    text_style ts,
    wstring_view fmt,
    wformat_args args);


Synopsis

Declared in <fmt/xchar.h>
template<
    typename S,
    typename Char = /* implementation-defined */>
std::basic_string<Char>
vformat(
    locale_ref loc,
    S const& fmt,
    basic_format_args<buffered_context<Char>> args);


vformat_to overloads

Synopses

Declared in <fmt/base.h>
template<size_t N>
format_to_result
vformat_to(
    char(& out)[],
    string_view fmt,
    format_args args);


» more... Formats a string and writes the output to out.
template<typename OutputIt>
remove_cvref_t<OutputIt>
vformat_to(
    OutputIt&& out,
    string_view fmt,
    format_args args);


» more...
template<
    typename OutputIt,
    typename S,
    typename Char = /* implementation-defined */>
OutputIt
vformat_to(
    OutputIt out,
    S const& fmt,
    basic_format_args<buffered_context<Char>> args);


» more...
template<typename OutputIt>
OutputIt
vformat_to(
    OutputIt out,
    locale_ref loc,
    string_view fmt,
    format_args args);


» more... Formats a string with the given text_style and writes the output to out.
template<typename OutputIt>
OutputIt
vformat_to(
    OutputIt out,
    text_style ts,
    string_view fmt,
    format_args args);


» more...
template<
    typename S,
    typename OutputIt,
    typename... Args,
    typename Char = /* implementation-defined */>
OutputIt
vformat_to(
    OutputIt out,
    locale_ref loc,
    S const& fmt,
    basic_format_args<buffered_context<Char>> args);


» more...

Synopsis

Declared in <fmt/base.h>
template<size_t N>
format_to_result
vformat_to(
    char(& out)[],
    string_view fmt,
    format_args args);


Formats a string and writes the output to out.

Synopsis

Declared in <fmt/base.h>
template<typename OutputIt>
remove_cvref_t<OutputIt>
vformat_to(
    OutputIt&& out,
    string_view fmt,
    format_args args);


Synopsis

Declared in <fmt/xchar.h>
template<
    typename OutputIt,
    typename S,
    typename Char = /* implementation-defined */>
OutputIt
vformat_to(
    OutputIt out,
    S const& fmt,
    basic_format_args<buffered_context<Char>> args);


Synopsis

Declared in <fmt/format.h>
template<typename OutputIt>
OutputIt
vformat_to(
    OutputIt out,
    locale_ref loc,
    string_view fmt,
    format_args args);


Formats a string with the given text_style and writes the output to out.

Synopsis

Declared in <fmt/color.h>
template<typename OutputIt>
OutputIt
vformat_to(
    OutputIt out,
    text_style ts,
    string_view fmt,
    format_args args);


Parameters

Name Description
ts A text style consisting of foreground and background colors and emphasis.

Synopsis

Declared in <fmt/xchar.h>
template<
    typename S,
    typename OutputIt,
    typename... Args,
    typename Char = /* implementation-defined */>
OutputIt
vformat_to(
    OutputIt out,
    locale_ref loc,
    S const& fmt,
    basic_format_args<buffered_context<Char>> args);


Synopses

Declared in <fmt/base.h>
template<
    typename OutputIt,
    typename... T>
format_to_n_result<OutputIt>
vformat_to_n(
    OutputIt out,
    size_t n,
    string_view fmt,
    format_args args);


» more...
template<
    typename OutputIt,
    typename Char,
    typename... Args>
format_to_n_result<OutputIt>
vformat_to_n(
    OutputIt out,
    size_t n,
    basic_string_view<Char> fmt,
    basic_format_args<buffered_context<Char>> args);


» more...

Synopsis

Declared in <fmt/base.h>
template<
    typename OutputIt,
    typename... T>
format_to_n_result<OutputIt>
vformat_to_n(
    OutputIt out,
    size_t n,
    string_view fmt,
    format_args args);


Synopsis

Declared in <fmt/xchar.h>
template<
    typename OutputIt,
    typename Char,
    typename... Args>
format_to_n_result<OutputIt>
vformat_to_n(
    OutputIt out,
    size_t n,
    basic_string_view<Char> fmt,
    basic_format_args<buffered_context<Char>> args);


Synopsis

Declared in <fmt/printf.h>
template<typename Char>
int
vfprintf(
    FILE* f,
    basic_string_view<Char> fmt,
    vprintf_args<Char>::type args);


Synopses

Declared in <fmt/base.h>
void
vprint(
    string_view fmt,
    format_args args);


» more...
void
vprint(
    wstring_view fmt,
    wformat_args args);


» more...
void
vprint(
    std::ostream& os,
    string_view fmt,
    format_args args);


» more...
void
vprint(
    std::wostream& os,
    wstring_view fmt,
    wformat_args args);


» more...
void
vprint(
    FILE* f,
    string_view fmt,
    format_args args);


» more...
void
vprint(
    FILE* f,
    wstring_view fmt,
    wformat_args args);


» more...
void
vprint(
    FILE* f,
    text_style ts,
    string_view fmt,
    format_args args);


» more...

Synopsis

Declared in <fmt/base.h>
void
vprint(
    string_view fmt,
    format_args args);


Synopsis

Declared in <fmt/xchar.h>
void
vprint(
    wstring_view fmt,
    wformat_args args);


Synopsis

Declared in <fmt/ostream.h>
void
vprint(
    std::ostream& os,
    string_view fmt,
    format_args args);


Synopsis

Declared in <fmt/xchar.h>
void
vprint(
    std::wostream& os,
    wstring_view fmt,
    wformat_args args);


Synopsis

Declared in <fmt/base.h>
void
vprint(
    FILE* f,
    string_view fmt,
    format_args args);


Synopsis

Declared in <fmt/xchar.h>
void
vprint(
    FILE* f,
    wstring_view fmt,
    wformat_args args);


Synopsis

Declared in <fmt/color.h>
void
vprint(
    FILE* f,
    text_style ts,
    string_view fmt,
    format_args args);


Synopsis

Declared in <fmt/base.h>
void
vprint_buffered(
    FILE* f,
    string_view fmt,
    format_args args);


Synopsis

Declared in <fmt/printf.h>
template<typename Char>
[[deprecated]]
int
vprintf(
    basic_string_view<Char> fmt,
    vprintf_args<Char>::type args);


Synopsis

Declared in <fmt/base.h>
void
vprintln(
    FILE* f,
    string_view fmt,
    format_args args);


Synopsis

Declared in <fmt/printf.h>
template<typename Char>
std::basic_string<Char>
vsprintf(
    basic_string_view<Char> fmt,
    vprintf_args<Char>::type args);


Synopsis

Declared in <fmt/format.h>
std::system_error
vsystem_error(
    int error_code,
    string_view fmt,
    format_args args);


Equality operator

Synopsis

Declared in <fmt/base.h>
constexpr
bool
operator==(
    basic_string_view lhs,
    basic_string_view rhs);


Return Value

true if the objects are equal, false otherwise

Parameters

Name Description
lhs The left operand
rhs The right operand
Inequality operator

Synopsis

Declared in <fmt/base.h>
bool
operator!=(
    basic_string_view lhs,
    basic_string_view rhs);


Return Value

true if the objects are not equal, false otherwise

Parameters

Name Description
lhs The left operand
rhs The right operand
Less-than operator

Synopsis

Declared in <fmt/base.h>
bool
operator<(
    basic_string_view lhs,
    basic_string_view rhs);


Return Value

true if the left object is less than the right object, false otherwise

Parameters

Name Description
lhs The left operand
rhs The right operand
Less-than-or-equal operator

Synopsis

Declared in <fmt/base.h>
bool
operator<=(
    basic_string_view lhs,
    basic_string_view rhs);


Return Value

true if the left object is less than or equal to the right object, false otherwise

Parameters

Name Description
lhs The left operand
rhs The right operand
Greater-than operator

Synopsis

Declared in <fmt/base.h>
bool
operator>(
    basic_string_view lhs,
    basic_string_view rhs);


Return Value

true if the left object is greater than the right object, false otherwise

Parameters

Name Description
lhs The left operand
rhs The right operand
Greater-than-or-equal operator

Synopsis

Declared in <fmt/base.h>
bool
operator>=(
    basic_string_view lhs,
    basic_string_view rhs);


Return Value

true if the left object is greater than or equal to the right object, false otherwise

Parameters

Name Description
lhs The left operand
rhs The right operand

Synopsis

Declared in <fmt/base.h>
template<
    typename T,
    typename Char = char>
concept formattable = is_formattable<remove_reference_t<T>, Char>::value;


Created with MrDocs