Reference
Namespaces
fmt namespace
Namespaces
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
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
Functions
Functions
Namespaces
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
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
Functions
Synopsis
Declared in <fmt/format.h>
template<typename Enum>
constexpr
underlying_t<Enum>
format_as(Enum e) noexcept;
Functions
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);
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>
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<
bool B,
typename T,
typename F>
using conditional_t = std::conditional<B, T, F>::type;
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_context = context;
Synopsis
Declared in <fmt/base.h>
template<typename... T>
using format_string = fstring<T...>::t;
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/base.h>
using nullptr_t = decltype(nullptr);
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/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/xchar.h>
template<typename... T>
using wformat_string = basic_format_string<wchar_t, T...>::t;
Synopsis
Declared in <fmt/base.h>
template<typename T>
class basic_appender;
Types
Member Functions
Protected Data Members
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
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
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
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
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 |
Constructors
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>
/* 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
Member Functions
Data Members
Description
void vlog(fmt::string_view fmt, fmt::format_args args); // OK fmt::format_args args = fmt::make_format_args(); // Dangling reference
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
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.
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>
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>
/* implementation-defined */ const* values_;
Synopsis
Declared in <fmt/xchar.h>
template<
typename Char,
typename... T>
struct basic_fstring;
Types
Member Functions
Constructors
Construct from runtime_format_string
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 |
Conversion to basic_string_view
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
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.
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.
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);
Member Functions
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
Enums
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>
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.
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>
locale_ref
locale();
Synopsis
Declared in <fmt/base.h>
class basic_specs;
Member Functions
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);
Synopsis
Declared in <fmt/base.h>
constexpr
void
set_fill(char c);
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_upper();
Synopsis
Declared in <fmt/base.h>
constexpr
sign
sign() 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
Member Functions
Synopsis
Declared in <fmt/base.h>
using iterator = Char const*;
Synopsis
Declared in <fmt/base.h>
using value_type = Char;
Constructors
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.
Synopsis
Declared in <fmt/base.h>
constexpr
bool
starts_with(Char c) 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
Friends
Name |
Description |
file |
|
|===
Constructors
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 |
Destructor
Synopsis
Declared in <fmt/os.h>
~buffered_file() noexcept;
Assignment operators
Synopsis
Declared in <fmt/os.h>
void
operator=(buffered_file const& other) = delete;
Move assignment operator
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
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/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
Synopsis
Declared in <fmt/base.h>
class context;
Types
Enums
Member Functions
Synopsis
Declared in <fmt/base.h>
using char_type = char;
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.
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.
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);
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
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
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
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
Using Declarations
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
Static Data Members
Protected Member Functions
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>
static
Locale::id id;
Synopsis
Declared in <fmt/format.h>
template<>
class format_facet<locale>
: public locale::facet
Base Classes
Name |
Description |
locale::facet | |
Member Functions
Static Data Members
Protected Member Functions
Constructors
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>
static
locale::id id;
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
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
Member Functions
Data Members
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_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. |
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
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 |
Default constructor
Synopsis
Declared in <fmt/base.h>
formatter() = delete;
Synopsis
Declared in <fmt/format-inl.h>
template<>
struct formatter</* implementation-defined */>;
Member Functions
Synopsis
Declared in <fmt/format.h>
template<>
struct formatter<bytes>;
Member Functions
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
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
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);
Member Functions
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);
Member Functions
Synopsis
Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::atomic_flag const& v,
FormatContext& ctx) const;
Member Functions
Static Member Functions
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
Synopsis
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
day d,
FormatContext& ctx) const;
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::monostate, Char>;
Member Functions
Synopsis
Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::monostate const&,
FormatContext& ctx) const;
Synopsis
Declared in <fmt/chrono.h>
template<typename Char>
struct formatter<month, Char>;
Member Functions
Synopsis
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
month m,
FormatContext& ctx) const;
Member Functions
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
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
void
set_debug_format(bool set = true);
Synopsis
Declared in <fmt/chrono.h>
template<typename Char>
struct formatter<tm, Char>;
Member Functions
Protected Member Functions
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>
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
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/chrono.h>
template<typename Char>
struct formatter<weekday, Char>;
Member Functions
Synopsis
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
weekday wd,
FormatContext& ctx) const;
Synopsis
Declared in <fmt/chrono.h>
template<typename Char>
struct formatter<year, Char>;
Member Functions
Synopsis
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
year y,
FormatContext& ctx) const;
Member Functions
Synopsis
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
year_month_day val,
FormatContext& ctx) const;
Member Functions
Synopsis
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
/* implementation-defined */ value,
FormatContext& ctx) const;
Member Functions
Synopsis
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
signed char value,
FormatContext& ctx) const;
Member Functions
Synopsis
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
unsigned char value,
FormatContext& ctx) const;
Member Functions
Synopsis
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
short value,
FormatContext& ctx) const;
Member Functions
Synopsis
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
unsigned short value,
FormatContext& ctx) const;
Member Functions
Synopsis
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
long value,
FormatContext& ctx) const;
Member Functions
Synopsis
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
unsigned long value,
FormatContext& ctx) const;
Member Functions
Synopsis
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
Char* value,
FormatContext& ctx) const;
Member Functions
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>
Member Functions
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
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>
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
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>
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
Member Functions
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/std.h>
template<
typename T,
typename Char>
requires std::is_base_of<std::exception, T>::value
struct formatter<T, Char>;
Member Functions
Synopsis
Declared in <fmt/std.h>
template<typename Context>
decltype(ctx.out())
format(
std::exception const& ex,
Context& ctx) const;
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>
Types
Member Functions
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
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/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
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>
template<
typename T,
typename Char>
requires is_formattable<T, Char>::value
struct formatter<std::atomic<T>, Char>
: formatter<T, Char>
Member Functions
Synopsis
Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::atomic<T> const& v,
FormatContext& ctx) const;
Member Functions
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
Synopsis
Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::complex<T> const& c,
FormatContext& ctx) const;
Member Functions
Synopsis
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
local_time<Duration> val,
FormatContext& ctx) const;
Member Functions
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/std.h>
template<
typename T,
typename Char>
requires is_formattable<T, Char>::value
struct formatter<std::optional<T>, Char>;
Member Functions
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>
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>
Member Functions
Synopsis
Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::reference_wrapper<T> ref,
FormatContext& ctx) const;
Member Functions
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>
Member Functions
Synopsis
Declared in <fmt/color.h>
template<typename FormatContext>
decltype(ctx.out())
format(
/* implementation-defined */ const& arg,
FormatContext& ctx) const;
Member Functions
Synopsis
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
sys_time<Duration> val,
FormatContext& ctx) const;
Member Functions
Synopsis
Declared in <fmt/ranges.h>
template<typename FormatContext>
FormatContext::iterator
format(
tuple_join_view<Tuple, Char> const& value,
FormatContext& ctx) const;
Member Functions
Synopsis
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
utc_time<Duration> val,
FormatContext& ctx) const;
Synopsis
Declared in <fmt/chrono.h>
template<
typename Rep,
typename Period,
typename Char>
struct formatter<std::chrono::duration<Rep, Period>, Char>;
Member Functions
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/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
Synopsis
Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::expected<T, E> const& value,
FormatContext& ctx) const;
Types
Member Functions
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;
Member Functions
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
Member Functions
Data Members
Synopsis
Declared in <fmt/base.h>
using t = fstring;
Constructors
Construct from runtime_format_string
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/format.h>
template<
typename OutputIt,
typename Char>
class generic_context;
Types
Enums
Member Functions
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
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>
void
operator=(generic_context const& other) = delete;
Synopsis
Declared in <fmt/format.h>
void
advance_to(iterator it);
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
Non-Member Functions
Name |
Description |
group_digits | Returns 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 | |
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
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
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
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
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
Data Members
Non-Member Functions
Name |
Description |
join | Returns a view that formats the iterator range [begin, end) with elements separated by sep . |
join | Returns a view that formats range with elements separated by sep . |
join | Returns an object that formats std::initializer_list with elements separated by sep . |
Synopsis
Declared in <fmt/ranges.h>
It begin;
Synopsis
Declared in <fmt/ranges.h>
Sentinel end;
Synopsis
Declared in <fmt/format.h>
class loc_value;
Member Functions
Constructors
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
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
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
Default constructor
Synopsis
Declared in <fmt/format.h>
constexpr
nested_formatter();
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
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
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.
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
Member Functions
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;
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
Enums
Member Functions
Static Data Members
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;
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
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_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
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
/* implementation-defined */&
underlying();
Synopsis
Declared in <fmt/color.h>
struct rgb;
Member Functions
Name |
Description |
rgb [constructor] | Constructors |
Data Members
Constructors
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
Non-Member Functions
Name |
Description |
runtime | Creates a runtime format string. |
Synopsis
Declared in <fmt/compile.h>
template<size_t N>
class static_format_result;
Member Functions
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/format.h>
class string_buffer;
Member Functions
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
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 |
format | Formats arguments and returns the result as a string using ANSI escape sequences to specify text formatting. |
print | Formats 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
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
Data Members
Non-Member Functions
Name |
Description |
join | Returns an object that formats std::tuple with elements separated by sep . |
Constructor
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>
Tuple const& tuple;
Synopsis
Declared in <fmt/printf.h>
template<typename Char>
struct vprintf_args;
Types
Synopsis
Declared in <fmt/chrono.h>
class weekday;
Member Functions
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
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
Constructors
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 |
|
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.
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 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);
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.
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/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
.
Description
*Example:
fmt::print("{}", fmt::join({1, 2, 3}, ", ")); // Output: "1, 2, 3"
Returns an object that formats std::tuple
with elements separated by sep
.
Description
*Example:
auto t = std::tuple<int, char>{1, 'a'}; fmt::print("{}", fmt::join(t, ", ")); // Output: 1, a
Returns a view that formats range
with elements separated by 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
Returns a view that formats the iterator range [begin, end)
with elements separated by 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
Bitwise disjunction operator
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
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.
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. |
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.
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
.
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.
Creates a runtime format string.
Description
*Example:
// Check format string at runtime instead of compile-time. fmt::print(fmt::runtime("{:d}"), "I am not a number");
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
.
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);
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...
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...
Formats a string and writes the output to out
.
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);
Formats a string with the given text_style and writes the output to out
.
Parameters
Name |
Description |
ts |
A text style consisting of foreground and background colors and emphasis. |
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/printf.h>
template<typename Char>
[[deprecated]]
int
vprintf(
basic_string_view<Char> fmt,
vprintf_args<Char>::type 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
Return Value
true
if the objects are equal, false
otherwise
Parameters
Name |
Description |
lhs |
The left operand |
rhs |
The right operand |
Inequality operator
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
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
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
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
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;