| Name |
|---|
fmt |
| Name |
|---|
enums |
safe_duration_cast |
| Name |
|---|
Unnamed enum |
align |
arg_id_kind |
color |
emphasis |
presentation_type |
range_format |
sign |
terminal_color |
| Name | Description |
|---|---|
Unnamed overloads | User-defined literal equivalent of fmt::arg, but with compile-time checks. |
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 |
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 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 | |
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 |
| Name |
|---|
formattable |
| Name | Description |
|---|---|
lossless_integral_conversion | Converts From to To, without loss. If the dynamic value of from can't be converted to To without loss, ec is set. |
safe_duration_cast | Safe duration_cast between floating point durations |
safe_float_conversion | converts From to To if possible, otherwise ec is set. |
| Name |
|---|
enums |
safe_duration_cast |
| Name |
|---|
Unnamed enum |
align |
arg_id_kind |
color |
emphasis |
presentation_type |
range_format |
sign |
terminal_color |
| Name | Description |
|---|---|
Unnamed overloads | User-defined literal equivalent of fmt::arg, but with compile-time checks. |
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 |
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 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 | |
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 |
| Name |
|---|
formattable |
Declared in <fmt/format.h>
template<typename Enum>
constexpr
underlying_t<Enum>
format_as(Enum e) noexcept;
| Name | Description |
|---|---|
lossless_integral_conversion | Converts From to To, without loss. If the dynamic value of from can't be converted to To without loss, ec is set. |
safe_duration_cast | Safe duration_cast between floating point durations |
safe_float_conversion | converts From to To if possible, otherwise ec is set. |
Converts From to To, without loss. If the dynamic value of from can't be converted to To without loss, ec is set.
Declared in <fmt/chrono.h>
template<
typename To,
typename From>
constexpr
To
lossless_integral_conversion(
From const from,
int& ec);
» more...
Converts From to To, without loss. If the dynamic value of from can't be converted to To without loss, ec is set.
template<
typename To,
typename From>
constexpr
To
lossless_integral_conversion(
From const from,
int& ec);
» more...
template<
typename To,
typename From>
constexpr
To
lossless_integral_conversion(
From const from,
int& ec);
» more...
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.
Declared in <fmt/chrono.h>
template<
typename To,
typename From>
constexpr
To
lossless_integral_conversion(
From const from,
int& ec);
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
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.
Declared in <fmt/chrono.h>
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...
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.
Declared in <fmt/chrono.h>
template<
typename To,
typename From>
constexpr
To
safe_float_conversion(
From const from,
int& ec);
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
Declared in <fmt/chrono.h>
template<
typename To,
typename From>
constexpr
To
safe_float_conversion(
From const from,
int& ec);
Declared in <fmt/base.h>
template<
typename OutputIt,
typename Char>
using basic_format_context = conditional_t<std::is_same<OutputIt, appender>::value, context, generic_context<OutputIt, Char>>;
Declared in <fmt/base.h>
template<typename Char>
using basic_format_parse_context = parse_context<Char>;
Declared in <fmt/xchar.h>
template<
typename Char,
typename... T>
using basic_format_string = basic_fstring<Char, T...>;
Declared in <fmt/base.h>
template<bool B>
using bool_constant = std::integral_constant<bool, B>;
Declared in <fmt/base.h>
template<typename Char>
using buffered_context = conditional_t<std::is_same<Char, char>::value, context, generic_context<basic_appender<Char>, Char>>;
Declared in <fmt/base.h>
template<
bool B,
typename T,
typename F>
using conditional_t = std::conditional<B, T, F>::type;
Declared in <fmt/chrono.h>
using day = std::chrono::day;
Declared in <fmt/base.h>
template<typename T>
using decay_t = std::decay<T>::type;
Declared in <fmt/base.h>
template<
bool B,
typename T = void>
using enable_if_t = T;
Declared in <fmt/base.h>
template<typename... T>
using format_string = fstring<T...>::t;
Declared in <fmt/base.h>
template<
typename T,
typename Char = char>
using is_formattable = bool_constant<!std::is_same<detail::mapped_t<conditional_t<std::is_void<T>::value, int *, T>, Char>, void>::value>;
Declared in <fmt/chrono.h>
template<class Duration>
using local_time = std::chrono::time_point</* implementation-defined */, Duration>;
Declared in <fmt/base.h>
template<typename T>
using make_unsigned_t = std::make_unsigned<T>::type;
Declared in <fmt/chrono.h>
using month = std::chrono::month;
Declared in <fmt/base.h>
template<
typename T,
typename Char = char>
using named_arg = /* implementation-defined */;
Declared in <fmt/base.h>
using nullptr_t = decltype(nullptr);
Declared in <fmt/base.h>
template<typename T>
using remove_const_t = std::remove_const<T>::type;
Declared in <fmt/base.h>
template<typename T>
using remove_cvref_t = std::remove_cv<remove_reference_t<T>>::type;
Declared in <fmt/base.h>
template<typename T>
using remove_reference_t = std::remove_reference<T>::type;
Declared in <fmt/chrono.h>
template<typename Duration>
using sys_time = std::chrono::time_point<std::chrono::system_clock, Duration>;
Declared in <fmt/base.h>
using ullong = unsigned long long;
Declared in <fmt/base.h>
template<typename T>
using underlying_t = std::underlying_type<T>::type;
Declared in <fmt/chrono.h>
template<typename Duration>
using utc_time = std::chrono::time_point</* implementation-defined */, Duration>;
Declared in <fmt/base.h>
template<typename... T>
using vargs = /* implementation-defined */;
Declared in <fmt/base.h>
template<typename...>
using void_t = void;
Declared in <fmt/chrono.h>
using weekday = std::chrono::weekday;
Declared in <fmt/xchar.h>
template<typename... T>
using wformat_string = basic_format_string<wchar_t, T...>::t;
Declared in <fmt/chrono.h>
using year = std::chrono::year;
Declared in <fmt/chrono.h>
using year_month_day = std::chrono::year_month_day;
Declared in <fmt/base.h>
template<typename T>
class basic_appender;
| Name |
|---|
container_type |
| Name | Description |
|---|---|
basic_appender [constructor] | Construct from buffer |
operator= | Assignment operator |
operator* | Dereference operator |
operator++ | Increment operators |
| Name |
|---|
container |
Declared in <fmt/base.h>
using container_type = /* implementation-defined */;
Construct from buffer
Declared in <fmt/base.h>
constexpr
basic_appender(/* implementation-defined */& buf);
| Name | Description |
|---|---|
| buf | The object to copy construct from |
Assignment operator
Reference to the current object
| Name | Description |
|---|---|
| c | The object to assign from |
Dereference operator
Reference to the current object
Increment operators
Declared in <fmt/base.h>
Increment operator
constexpr
basic_appender&
operator++();
» more...
Increment operator
constexpr
basic_appender
operator++(int);
» more...
Increment operator
Reference to the current object
Increment operator
Another instance of the object
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.
Declared in <fmt/os.h>
template<typename Char>
class basic_cstring_view;
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.
| Name | Description |
|---|---|
basic_cstring_view [constructor] | Constructors |
c_str | Returns the pointer to a C string. |
Constructors
Declared in <fmt/os.h>
Constructs a string reference from an std::string object.
basic_cstring_view(std::basic_string<Char> const& s);
» more...
Constructs a string reference object from a C string.
basic_cstring_view(Char const* s);
» more...
Constructs a string reference from an std::string object.
Declared in <fmt/os.h>
basic_cstring_view(std::basic_string<Char> const& s);
| Name | Description |
|---|---|
| s | The object to copy construct from |
Constructs a string reference object from a C string.
Declared in <fmt/os.h>
basic_cstring_view(Char const* s);
| Name | Description |
|---|---|
| s | The object to construct from |
Returns the pointer to a C string.
Declared in <fmt/os.h>
Char const*
c_str() const;
the pointer to a C string.
Declared in <fmt/base.h>
template<typename Context>
class basic_format_arg;
| Name |
|---|
handle |
| 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 |
| Name | Description |
|---|---|
fmt::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: |
Declared in <fmt/base.h>
class handle;
| Name | Description |
|---|---|
handle [constructor] | Construct from custom_value |
format |
Construct from custom_value
Declared in <fmt/base.h>
explicit
handle(/* implementation-defined */ custom);
| Name | Description |
|---|---|
| custom | The object to construct from |
Declared in <fmt/base.h>
void
format(
parse_context<char_type>& parse_ctx,
Context& ctx) const;
Constructors
Declared in <fmt/base.h>
Default constructor
constexpr
basic_format_arg();
» more...
Construct from T
template<typename T>
basic_format_arg(T&& val);
» more...
basic_format_arg(
/* implementation-defined */ const* args,
size_t size);
» more...
Default constructor
Declared in <fmt/base.h>
constexpr
basic_format_arg();
Construct from T
Declared in <fmt/base.h>
template<typename T>
basic_format_arg(T&& val);
| Name | Description |
|---|---|
| val | The object to move construct from |
Declared in <fmt/base.h>
basic_format_arg(
/* implementation-defined */ const* args,
size_t size);
Declared in <fmt/base.h>
bool
format_custom(
char_type const* parse_begin,
parse_context<char_type>& parse_ctx,
Context& ctx);
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.
Declared in <fmt/base.h>
template<typename Visitor>
constexpr
decltype(vis(0))
visit(Visitor&& vis) const;
Conversion to bool
Declared in <fmt/base.h>
constexpr
explicit
operator bool() const noexcept;
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:
Declared in <fmt/base.h>
template<typename Context>
class basic_format_args;
void vlog(fmt::string_view fmt, fmt::format_args args); // OK fmt::format_args args = fmt::make_format_args(); // Dangling reference
| Name |
|---|
format_arg |
| Name | Description |
|---|---|
basic_format_args [constructor] | Constructors |
get | Returns the argument with the specified id. |
get_id | |
max_size |
| Name |
|---|
args_ [variant member] |
values_ [variant member] |
Constructors
Declared in <fmt/base.h>
Default constructor
constexpr
basic_format_args();
» more...
Constructs a basic_format_args object from format_arg_store.
template<
int NUM_ARGS,
int NUM_NAMED_ARGS,
ullong DESC>
[[always_inline]]
constexpr
basic_format_args(store<NUM_ARGS, NUM_NAMED_ARGS, DESC> const& s);
» more...
Construct from store
template<
int NUM_ARGS,
int NUM_NAMED_ARGS,
ullong DESC>
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
Declared in <fmt/base.h>
constexpr
basic_format_args();
Constructs a basic_format_args object from format_arg_store.
Declared in <fmt/base.h>
template<
int NUM_ARGS,
int NUM_NAMED_ARGS,
ullong DESC>
[[always_inline]]
constexpr
basic_format_args(store<NUM_ARGS, NUM_NAMED_ARGS, DESC> const& s);
| Name | Description |
|---|---|
| s | The object to copy construct from |
Construct from store
Declared in <fmt/base.h>
template<
int NUM_ARGS,
int NUM_NAMED_ARGS,
ullong DESC>
constexpr
basic_format_args(store<NUM_ARGS, NUM_NAMED_ARGS, DESC> const& s);
| Name | Description |
|---|---|
| s | The object to copy construct from |
Constructs a basic_format_args object from a dynamic list of arguments.
Declared in <fmt/base.h>
constexpr
basic_format_args(
format_arg const* args,
int count,
bool has_named = false);
| Name | Description |
|---|---|
| args | The object to construct from |
Returns the argument with the specified id.
Declared in <fmt/base.h>
Returns the argument with the specified id.
constexpr
format_arg
get(int id) const;
» more...
template<typename Char>
format_arg
get(basic_string_view<Char> name) const;
» more...
Returns the argument with the specified id.
the argument with the specified id.
Declared in <fmt/base.h>
template<typename Char>
format_arg
get(basic_string_view<Char> name) const;
Declared in <fmt/base.h>
template<typename Char>
constexpr
int
get_id(basic_string_view<Char> name) const;
Declared in <fmt/base.h>
int
max_size() const;
Declared in <fmt/base.h>
/* implementation-defined */ const* values_;
Declared in <fmt/xchar.h>
template<
typename Char,
typename... T>
struct basic_fstring;
| Name |
|---|
t |
| Name | Description |
|---|---|
basic_fstring [constructor] | Constructors |
get | |
operator basic_string_view<Char> | Conversion to basic_string_view |
Constructors
Declared in <fmt/xchar.h>
Construct from runtime_format_string
basic_fstring(runtime_format_string<Char> fmt);
» more...
Construct from S
template<typename S>
[[always_inline]]
basic_fstring(S const& value);
» more...
Construct from S
template<typename S>
[[always_inline]]
consteval
basic_fstring(S const& s);
» more...
Construct from runtime_format_string
| Name | Description |
|---|---|
| fmt | The object to construct from |
Construct from S
Declared in <fmt/xchar.h>
template<typename S>
[[always_inline]]
basic_fstring(S const& value);
| Name | Description |
|---|---|
| value | The object to copy construct from |
Construct from S
Declared in <fmt/xchar.h>
template<typename S>
[[always_inline]]
consteval
basic_fstring(S const& s);
| Name | Description |
|---|---|
| s | The object to copy construct from |
Conversion to basic_string_view
An implementation of std::basic_string_view for pre-C++17 providing a subset of the API. fmt::basic_string_view is used in the public API 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.
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 */
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).
| 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. |
| Name |
|---|
const_reference |
value_type |
| 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. |
Declared in <fmt/format.h>
using const_reference = T const&;
Declared in <fmt/format.h>
using value_type = T;
Constructs a basic_memory_buffer object moving the content of the other object to it.
Declared in <fmt/format.h>
Constructs a basic_memory_buffer object moving the content of the other object to it.
constexpr
basic_memory_buffer(basic_memory_buffer&& other) noexcept;
» more...
Default constructor
constexpr
explicit
basic_memory_buffer(Allocator const& alloc = Allocator());
» more...
Constructs a basic_memory_buffer object moving the content of the other object to it.
Declared in <fmt/format.h>
constexpr
basic_memory_buffer(basic_memory_buffer&& other) noexcept;
| Name | Description |
|---|---|
| other | The object to move construct from |
Default constructor
Declared in <fmt/format.h>
constexpr
explicit
basic_memory_buffer(Allocator const& alloc = Allocator());
| Name | Description |
|---|---|
| alloc | The object to copy construct from |
Destructor
Declared in <fmt/format.h>
constexpr
~basic_memory_buffer();
Moves the content of the other basic_memory_buffer object to this one.
Declared in <fmt/format.h>
basic_memory_buffer&
operator=(basic_memory_buffer&& other) noexcept;
Reference to the current object
| Name | Description |
|---|---|
| other | The object to move assign from |
Declared in <fmt/format.h>
template<typename ContiguousRange>
constexpr
void
append(ContiguousRange const& range);
Declared in <fmt/format.h>
Allocator
get_allocator() const;
Increases the buffer capacity to new_capacity.
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.
Declared in <fmt/format.h>
constexpr
void
resize(size_t count);
Declared in <fmt/ostream.h>
template<typename Char>
struct basic_ostream_formatter
: formatter<basic_string_view<Char>, Char>
| Name | Description |
|---|---|
formatter<basic_string_view<Char>, Char> |
| Name |
|---|
format |
set_debug_format [deleted] |
| Name | Description |
|---|---|
formatter<std::thread::id, Char> | |
formatter</* implementation-defined */, Char> |
Declared in <fmt/ostream.h>
template<
typename T,
typename Context>
decltype(ctx.out())
format(
T const& value,
Context& ctx) const;
Declared in <fmt/ostream.h>
void
set_debug_format() = delete;
Declared in <fmt/printf.h>
template<typename Char>
class basic_printf_context;
| Name |
|---|
char_type |
| Name |
|---|
Unnamed enum |
| 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 |
Declared in <fmt/printf.h>
using char_type = Char;
Declared in <fmt/printf.h>
enum Unnamed enum;
| Name |
|---|
builtin_types |
Constructs a printf_context object. References to the arguments are stored in the context object so make sure they have appropriate lifetimes.
Declared in <fmt/printf.h>
basic_printf_context(
basic_appender<Char> out,
basic_format_args<basic_printf_context> args);
| 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: |
Declared in <fmt/base.h>
class basic_specs;
| Name | Description |
|---|---|
format_specs |
Declared in <fmt/base.h>
constexpr
bool
alt() const;
Declared in <fmt/base.h>
constexpr
void
clear_alt();
Declared in <fmt/base.h>
constexpr
bool
dynamic() const;
Declared in <fmt/base.h>
template<typename Char>
constexpr
Char const*
fill() const;
Declared in <fmt/base.h>
template<typename Char>
constexpr
Char const*
fill() const;
Declared in <fmt/base.h>
constexpr
size_t
fill_size() const;
Declared in <fmt/base.h>
template<typename Char>
constexpr
Char
fill_unit() const;
Declared in <fmt/base.h>
constexpr
bool
localized() const;
Declared in <fmt/base.h>
constexpr
void
set_alt();
Declared in <fmt/base.h>
constexpr
void
set_fill(char c);
» more...
template<typename Char>
constexpr
void
set_fill(basic_string_view<Char> s);
» more...
Declared in <fmt/base.h>
constexpr
void
set_fill(char c);
Declared in <fmt/base.h>
template<typename Char>
constexpr
void
set_fill(basic_string_view<Char> s);
Declared in <fmt/base.h>
constexpr
void
set_localized();
Declared in <fmt/base.h>
constexpr
void
set_upper();
Declared in <fmt/base.h>
constexpr
bool
upper() const;
An implementation of std::basic_string_view for pre-C++17 providing a subset of the API. fmt::basic_string_view is used in the public API 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).
Declared in <fmt/base.h>
template<typename Char>
class basic_string_view;
| Name |
|---|
iterator |
value_type |
| Name | Description |
|---|---|
basic_string_view [constructor] | Constructors |
begin | |
compare | |
data | |
end | |
operator[] | |
remove_prefix | |
size | |
starts_with |
| Name | Description |
|---|---|
fmt::operator>= | Greater-than-or-equal operator |
fmt::operator> | Greater-than operator |
fmt::operator<= | Less-than-or-equal operator |
fmt::operator< | Less-than operator |
fmt::operator!= | Inequality operator |
fmt::operator== | Equality operator |
Declared in <fmt/base.h>
using iterator = Char const*;
Declared in <fmt/base.h>
using value_type = Char;
Constructors
Declared in <fmt/base.h>
Default constructor
constexpr
basic_string_view() noexcept;
» more...
Construct from Char
constexpr
basic_string_view(Char const* s);
» more...
Construct from S
template<typename S>
constexpr
basic_string_view(S const& s) noexcept;
» more...
constexpr
basic_string_view(
Char const* s,
size_t count) noexcept;
» more...
Default constructor
Declared in <fmt/base.h>
constexpr
basic_string_view() noexcept;
Construct from Char
Declared in <fmt/base.h>
constexpr
basic_string_view(Char const* s);
| Name | Description |
|---|---|
| s | The object to construct from |
Construct from S
Declared in <fmt/base.h>
template<typename S>
constexpr
basic_string_view(S const& s) noexcept;
| Name | Description |
|---|---|
| s | The object to copy construct from |
Declared in <fmt/base.h>
constexpr
basic_string_view(
Char const* s,
size_t count) noexcept;
Declared in <fmt/base.h>
constexpr
Char const*
data() const noexcept;
Declared in <fmt/base.h>
constexpr
Char const&
operator[](size_t pos) const noexcept;
Declared in <fmt/base.h>
constexpr
void
remove_prefix(size_t n) noexcept;
Declared in <fmt/base.h>
constexpr
size_t
size() const noexcept;
Declared in <fmt/base.h>
constexpr
bool
starts_with(Char c) const noexcept;
» more...
constexpr
bool
starts_with(basic_string_view sv) const noexcept;
» more...
constexpr
bool
starts_with(Char const* s) const;
» more...
Declared in <fmt/base.h>
constexpr
bool
starts_with(Char c) const noexcept;
Declared in <fmt/base.h>
constexpr
bool
starts_with(Char const* s) const;
Declared in <fmt/os.h>
class buffered_file;
| Name | Description |
|---|---|
buffered_file [constructor] | Constructors |
~buffered_file [destructor] | Destructor |
operator= [deleted] | Assignment operators |
close | |
descriptor | |
get | |
print |
| Name | Description |
|---|---|
fmt::file |
Constructors
Declared in <fmt/os.h>
Default constructor
buffered_file() noexcept;
» more...
Copy constructor
buffered_file(buffered_file const& other) = delete;
» more...
Move constructor
buffered_file(buffered_file&& other) noexcept;
» more...
buffered_file(
cstring_view filename,
cstring_view mode);
» more...
Default constructor
Declared in <fmt/os.h>
buffered_file() noexcept;
Copy constructor
| Name | Description |
|---|---|
| other | The object to copy construct from |
Move constructor
| Name | Description |
|---|---|
| other | The object to move construct from |
Destructor
Declared in <fmt/os.h>
~buffered_file() noexcept;
Assignment operators
Declared in <fmt/os.h>
void
operator=(buffered_file const& other) = delete;
» more...
Move assignment operator
buffered_file&
operator=(buffered_file&& other);
» more...
Move assignment operator
Reference to the current object
| Name | Description |
|---|---|
| other | The object to move assign from |
Declared in <fmt/os.h>
void
close();
Declared in <fmt/os.h>
int
descriptor() const;
Declared in <fmt/os.h>
FILE*
get() const noexcept;
Declared in <fmt/os.h>
template<typename... T>
void
print(
string_view fmt,
T const&... args);
Declared in <fmt/format.h>
struct bytes;
| Name | Description |
|---|---|
bytes [constructor] | Construct from string_view |
| Name |
|---|
data |
Construct from string_view
| Name | Description |
|---|---|
| s | The object to construct from |
Declared in <fmt/compile.h>
class compiled_string;
Declared in <fmt/ranges.h>
template<typename...>
struct conjunction
: std::true_type
| Name | Description |
|---|---|
std::true_type |
| Name | Description |
|---|---|
P |
Declared in <fmt/ranges.h>
template<
typename P1,
typename... Pn>
struct conjunction<P1, Pn...>
: conditional_t<bool(P1::value), conjunction<Pn...>, P1>
| Name | Description |
|---|---|
conditional_t<bool(P1::value), conjunction<Pn...>, P1> |
Declared in <fmt/base.h>
class context;
| Name |
|---|
char_type |
format_arg |
iterator |
| Name |
|---|
Unnamed enum |
| Name | Description |
|---|---|
context [constructor] [deleted] | Constructs a context object. References to the arguments are stored in the object so make sure they have appropriate lifetimes. |
operator= [deleted] | |
advance_to | |
arg | |
arg_id | |
args | |
locale | |
out |
Declared in <fmt/base.h>
using char_type = char;
Declared in <fmt/base.h>
enum Unnamed enum;
| Name |
|---|
builtin_types |
Constructs a context object. References to the arguments are stored in the object so make sure they have appropriate lifetimes.
Declared in <fmt/base.h>
Copy constructor
context(context const& other) = delete;
» more...
Move constructor
constexpr
context(context&& other) = default;
» more...
Constructs a context object. References to the arguments are stored in the object so make sure they have appropriate lifetimes.
constexpr
context(
iterator out,
format_args args,
locale_ref loc = {});
» more...
Copy constructor
| Name | Description |
|---|---|
| other | The object to copy construct from |
Move constructor
| 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.
Declared in <fmt/base.h>
constexpr
context(
iterator out,
format_args args,
locale_ref loc = {});
| Name | Description |
|---|---|
| out | The object to construct from |
Declared in <fmt/base.h>
constexpr
format_arg
arg(int id) const;
» more...
format_arg
arg(string_view name) const;
» more...
A dynamic list of formatting arguments with storage.
Declared in <fmt/args.h>
template<typename Context>
class dynamic_format_arg_store;
It can be implicitly converted into fmt::basic_format_args for passing into type-erased formatting functions such as fmt::vformat.
| Name | Description |
|---|---|
dynamic_format_arg_store [constructor] | Default constructor |
clear | Erase all elements from the store. |
push_back | push_back overloads |
reserve | Reserves space to store at least new_cap arguments including new_cap_named named arguments. |
size | Returns the number of elements in the store. |
operator basic_format_args<Context> | Conversion to basic_format_args |
| Name | Description |
|---|---|
fmt::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: |
Default constructor
Declared in <fmt/args.h>
constexpr
dynamic_format_arg_store() = default;
Erase all elements from the store.
Declared in <fmt/args.h>
void
clear();
push_back overloads
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(named_arg<T, char_type> const& arg);
» more...
Adds a reference to the argument into the dynamic store for later passing to a formatting function.
Declared in <fmt/args.h>
template<typename T>
void
push_back(std::reference_wrapper<T> arg);
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"
| Name | Description |
|---|---|
| arg | Primary class template for reference_wrapper. |
Adds an argument into the dynamic store for later passing to a formatting function.
Declared in <fmt/args.h>
template<typename T>
void
push_back(T const& arg);
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.
Declared in <fmt/args.h>
template<typename T>
void
push_back(named_arg<T, char_type> const& arg);
Reserves space to store at least new_cap arguments including new_cap_named named arguments.
Declared in <fmt/args.h>
void
reserve(
size_t new_cap,
size_t new_cap_named);
Returns the number of elements in the store.
Declared in <fmt/args.h>
size_t
size() const noexcept;
the number of elements in the store.
Conversion to 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:
Declared in <fmt/os.h>
class file;
An error reported from a formatting function.
Declared in <fmt/format.h>
class format_error
: public std::runtime_error
| Name | Description |
|---|---|
std::runtime_error | One of two subclasses of exception. |
| Name | Description |
|---|---|
operator= | Assignment operators |
what [virtual] | Returns a C-style character string describing the general cause of the current error (the same string passed to the ctor). |
| Name |
|---|
format_error |
Assignment operators
Assignment operator
Declared in <stdexcept>
runtime_error&
operator=(runtime_error const& value) noexcept;
One of two subclasses of exception.
| Name | Description |
|---|---|
| value | The object to copy assign from |
Assignment operator
Declared in <stdexcept>
runtime_error&
operator=(runtime_error&& value) noexcept;
One of two subclasses of exception.
| Name | Description |
|---|---|
| value | The object to move assign from |
Returns a C-style character string describing the general cause of the current error (the same string passed to the ctor).
Declared in <stdexcept>
virtual
char const*
what() const noexcept;
Declared in <fmt/format.h>
using std::runtime_error::format_error;
Declared in <fmt/format.h>
template<typename Locale>
class format_facet
: public Locale::facet
| Name | Description |
|---|---|
Locale::facet |
| Name | Description |
|---|---|
format_facet [constructor] | Construct from Locale |
format_facet [constructor] | |
put |
| Name |
|---|
id |
| Name |
|---|
do_put [virtual] |
Construct from Locale
Declared in <fmt/format.h>
explicit
format_facet(Locale& loc);
| Name | Description |
|---|---|
| loc | The object to copy construct from |
Declared in <fmt/format.h>
explicit
format_facet(
string_view sep = "",
std::string grouping = "\3",
std::string decimal_point = ".");
Declared in <fmt/format.h>
bool
put(
appender out,
loc_value val,
format_specs const& specs) const;
Declared in <fmt/format.h>
static
Locale::id id;
Declared in <fmt/format.h>
virtual
bool
do_put(
appender out,
loc_value val,
format_specs const& specs) const;
| Name | Description |
|---|---|
locale::facet | Localization functionality base class. |
| Name | Description |
|---|---|
format_facet [constructor] | Constructors |
put |
| Name |
|---|
id |
| Name |
|---|
__shim |
| Name | Description |
|---|---|
operator= [deleted] | Assignment operator |
do_put [virtual] |
| Name |
|---|
_S_clone_c_locale |
_S_create_c_locale |
_S_destroy_c_locale |
_S_get_c_locale |
_S_get_c_name |
_S_lc_ctype_c_locale |
Constructors
Declared in <fmt/format.h>
Construct from locale
explicit
format_facet(locale& loc);
» more...
explicit
format_facet(
string_view sep = "",
std::string grouping = "\3",
std::string decimal_point = ".");
» more...
Construct from locale
Declared in <fmt/format.h>
explicit
format_facet(locale& loc);
| Name | Description |
|---|---|
| loc | The object to copy construct from |
Declared in <fmt/format.h>
explicit
format_facet(
string_view sep = "",
std::string grouping = "\3",
std::string decimal_point = ".");
Declared in <fmt/format.h>
bool
put(
appender out,
loc_value val,
format_specs const& specs) const;
Declared in <fmt/format.h>
static
locale::id id;
Declared in <bits/locale_classes.h>
class __shim;
Assignment operator
Declared in <bits/locale_classes.h>
facet&
operator=(facet const& value) = delete;
Localization functionality base class.
| Name | Description |
|---|---|
| value | The object to copy assign from |
Declared in <fmt/format.h>
virtual
bool
do_put(
appender out,
loc_value val,
format_specs const& specs) const;
Declared in <bits/locale_classes.h>
static
__c_locale
_S_clone_c_locale(__c_locale& __cloc);
Declared in <bits/locale_classes.h>
static
void
_S_create_c_locale(
__c_locale& __cloc,
char const* __s,
__c_locale __old = 0);
Declared in <bits/locale_classes.h>
static
void
_S_destroy_c_locale(__c_locale& __cloc);
Declared in <bits/locale_classes.h>
static
__c_locale
_S_get_c_locale();
Declared in <bits/locale_classes.h>
[[__const__]]
static
char const*
_S_get_c_name();
Declared in <bits/locale_classes.h>
static
__c_locale
_S_lc_ctype_c_locale(
__c_locale __cloc,
char const* __s);
A fast integer formatter.
Declared in <fmt/format.h>
class format_int;
| 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
Declared in <fmt/format.h>
Construct from int
constexpr
explicit
format_int(int value);
» more...
Construct from long
constexpr
explicit
format_int(long value);
» more...
Construct from long long
constexpr
explicit
format_int(long long value);
» more...
Construct from ullong
constexpr
explicit
format_int(ullong value);
» more...
Construct from unsigned int
constexpr
explicit
format_int(unsigned int value);
» more...
Construct from unsigned long
constexpr
explicit
format_int(unsigned long value);
» more...
Construct from int
Declared in <fmt/format.h>
constexpr
explicit
format_int(int value);
| Name | Description |
|---|---|
| value | The value to construct from |
Construct from long
Declared in <fmt/format.h>
constexpr
explicit
format_int(long value);
| Name | Description |
|---|---|
| value | The value to construct from |
Construct from long long
Declared in <fmt/format.h>
constexpr
explicit
format_int(long long value);
| Name | Description |
|---|---|
| value | The value to construct from |
Construct from ullong
| Name | Description |
|---|---|
| value | The object to construct from |
Construct from unsigned int
Declared in <fmt/format.h>
constexpr
explicit
format_int(unsigned int value);
| Name | Description |
|---|---|
| value | The value to construct from |
Construct from unsigned long
Declared in <fmt/format.h>
constexpr
explicit
format_int(unsigned long value);
| Name | Description |
|---|---|
| value | The value to construct from |
Returns a pointer to the output buffer content with terminating null character appended.
Declared in <fmt/format.h>
constexpr
char const*
c_str() const;
Returns a pointer to the output buffer content. No terminating null character is appended.
Declared in <fmt/format.h>
constexpr
char const*
data() const;
Returns the number of characters written to the output buffer.
Declared in <fmt/format.h>
constexpr
size_t
size() const;
the number of characters written to the output buffer.
Returns the content of the output buffer as an std::string.
Declared in <fmt/format.h>
std::string
str() const;
the content of the output buffer as an std::string.
| Name | Description |
|---|---|
basic_specs |
| Name | Description |
|---|---|
format_specs [constructor] | Default constructor |
align | |
alt | |
clear_alt | |
copy_fill_from | |
dynamic | |
dynamic_precision | |
dynamic_width | |
fill | |
fill_size | |
fill_unit | |
localized | |
set_align | |
set_alt | |
set_dynamic_precision | |
set_dynamic_width | |
set_fill | |
set_localized | |
set_sign | |
set_type | |
set_upper | |
sign | |
type | |
upper |
| Name |
|---|
precision |
width |
Default constructor
Declared in <fmt/base.h>
constexpr
format_specs();
Declared in <fmt/base.h>
int precision;
Declared in <fmt/base.h>
int width;
Declared in <fmt/base.h>
template<typename OutputIt>
struct format_to_n_result;
| Name | Description |
|---|---|
out | Iterator past the end of the output range. |
size | Total (not truncated) output size. |
| 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.
Declared in <fmt/base.h>
OutputIt out;
Total (not truncated) output size.
Declared in <fmt/base.h>
size_t size;
Declared in <fmt/base.h>
struct format_to_result;
| Name | Description |
|---|---|
operator char* | Conversion to char |
| Name | Description |
|---|---|
out | Pointer to just after the last successful write. |
truncated | Specifies if the output was truncated. |
Conversion to char
Declared in <fmt/base.h>
constexpr
operator char*() const;
The object converted to char
Pointer to just after the last successful write.
Declared in <fmt/base.h>
char* out;
Specifies if the output was truncated.
Declared in <fmt/base.h>
bool truncated;
Declared in <fmt/base.h>
template<
typename T,
typename Char = char,
typename Enable = void>
struct formatter;
| Name | Description |
|---|---|
formatter [constructor] [deleted] | Default constructor |
Default constructor
Declared in <fmt/base.h>
formatter() = delete;
Declared in <fmt/format-inl.h>
format_context::iterator
format(
/* implementation-defined */ const& n,
format_context& ctx) const;
Declared in <fmt/format-inl.h>
constexpr
format_parse_context::iterator
parse(format_parse_context& ctx);
Declared in <fmt/format.h>
template<typename FormatContext>
decltype(ctx.out())
format(
bytes b,
FormatContext& ctx) const;
Declared in <fmt/std.h>
template<typename FormatContext>
constexpr
decltype(ctx.out())
format(
std::error_code const& ec,
FormatContext& ctx) const;
Declared in <fmt/std.h>
constexpr
void
set_debug_format(bool set = true);
Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::source_location const& loc,
FormatContext& ctx) const;
Declared in <fmt/std.h>
template<typename Context>
decltype(ctx.out())
format(
std::type_info const& ti,
Context& ctx) const;
Declared in <fmt/format.h>
template<typename T>
struct formatter<group_digits_view<T>>
: formatter<T>
| Name | Description |
|---|---|
formatter<T> |
| Name |
|---|
format |
parse |
Declared in <fmt/format.h>
template<typename FormatContext>
decltype(ctx.out())
format(
group_digits_view<T> view,
FormatContext& ctx) const;
Declared in <fmt/std.h>
template<typename T>
requires std::is_base_of<std::exception, T>::value
struct formatter<T, char>;
| Name |
|---|
format |
parse |
Declared in <fmt/std.h>
template<typename Context>
decltype(ctx.out())
format(
std::exception const& ex,
Context& ctx) const;
Declared in <fmt/std.h>
template<typename Char>
struct formatter<std::atomic_flag, Char>
: formatter<bool, Char>
| Name | Description |
|---|---|
formatter<bool, Char> |
| Name |
|---|
format |
Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::atomic_flag const& v,
FormatContext& ctx) const;
Declared in <fmt/std.h>
template<typename Char>
struct formatter<std::byte, Char>
: formatter<unsigned int, Char>
| Name | Description |
|---|---|
formatter<unsigned int, Char> |
| Name |
|---|
format |
| Name |
|---|
format_as |
Declared in <fmt/std.h>
template<typename Context>
constexpr
decltype(ctx.out())
format(
std::byte b,
Context& ctx) const;
Declared in <fmt/std.h>
constexpr
static
unsigned char
format_as(std::byte b);
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
day d,
FormatContext& ctx) const;
Declared in <fmt/format.h>
template<typename Char>
struct formatter</* implementation-defined */, Char>
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name |
|---|
format |
parse |
set_debug_format |
Declared in <fmt/base.h>
template<typename FormatContext>
constexpr
decltype(ctx.out())
format(
T const& val,
FormatContext& ctx) const;
Declared in <fmt/base.h>
template</* implementation-defined */ U = TYPE>
constexpr
void
set_debug_format(bool set = true);
Declared in <fmt/std.h>
template<typename Char>
struct formatter<std::thread::id, Char>
: basic_ostream_formatter<Char>
| Name | Description |
|---|---|
basic_ostream_formatter<Char> |
| Name |
|---|
format |
set_debug_format [deleted] |
Declared in <fmt/format.h>
template<typename Char>
struct formatter<long, Char>
: formatter</* implementation-defined */, Char>
| Name | Description |
|---|---|
formatter</* implementation-defined */, Char> |
| Name |
|---|
format |
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
long value,
FormatContext& ctx) const;
Declared in <fmt/std.h>
template<typename FormatContext>
constexpr
decltype(ctx.out())
format(
std::monostate const&,
FormatContext& ctx) const;
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
month m,
FormatContext& ctx) const;
Declared in <fmt/format.h>
template<typename Char>
struct formatter<std::nullptr_t, Char>
: formatter<void const*, Char>
| Name | Description |
|---|---|
formatter<void const*, Char> |
| Name |
|---|
format |
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
std::nullptr_t value,
FormatContext& ctx) const;
Declared in <fmt/std.h>
template<typename Char>
struct formatter<std::filesystem::path, Char>;
| Name |
|---|
format |
parse |
set_debug_format |
Declared in <fmt/std.h>
template<typename FormatContext>
auto
format(
std::filesystem::path const& p,
FormatContext& ctx) const;
Declared in <fmt/std.h>
constexpr
void
set_debug_format(bool set = true);
Declared in <fmt/format.h>
template<typename Char>
struct formatter<short, Char>
: formatter<int, Char>
| Name | Description |
|---|---|
formatter<int, Char> |
| Name |
|---|
format |
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
short value,
FormatContext& ctx) const;
Declared in <fmt/format.h>
template<typename Char>
struct formatter<signed char, Char>
: formatter<int, Char>
| Name | Description |
|---|---|
formatter<int, Char> |
| Name |
|---|
format |
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
signed char value,
FormatContext& ctx) const;
| Name |
|---|
format |
parse |
| Name |
|---|
do_format |
do_parse |
localized |
set_localized |
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
tm const& tm,
FormatContext& ctx) const;
Declared in <fmt/chrono.h>
template<
typename Duration,
typename FormatContext>
decltype(ctx.out())
do_format(
tm const& tm,
FormatContext& ctx,
Duration const* subsecs) const;
Declared in <fmt/chrono.h>
constexpr
Char const*
do_parse(
parse_context<Char>& ctx,
bool has_timezone);
Declared in <fmt/chrono.h>
bool
localized() const;
Declared in <fmt/chrono.h>
constexpr
void
set_localized();
Declared in <fmt/format.h>
template<typename Char>
struct formatter<unsigned char, Char>
: formatter<unsigned int, Char>
| Name | Description |
|---|---|
formatter<unsigned int, Char> |
| Name |
|---|
format |
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
unsigned char value,
FormatContext& ctx) const;
Declared in <fmt/format.h>
template<typename Char>
struct formatter<unsigned long, Char>
: formatter</* implementation-defined */, Char>
| Name | Description |
|---|---|
formatter</* implementation-defined */, Char> |
| Name |
|---|
format |
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
unsigned long value,
FormatContext& ctx) const;
Declared in <fmt/format.h>
template<typename Char>
struct formatter<unsigned short, Char>
: formatter<unsigned int, Char>
| Name | Description |
|---|---|
formatter<unsigned int, Char> |
| Name |
|---|
format |
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
unsigned short value,
FormatContext& ctx) const;
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
weekday wd,
FormatContext& ctx) const;
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
year y,
FormatContext& ctx) const;
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
year_month_day val,
FormatContext& ctx) const;
Declared in <fmt/format.h>
template<typename Char>
struct formatter</* implementation-defined */, Char>
: formatter<basic_string_view<Char>, Char>
| Name | Description |
|---|---|
formatter<basic_string_view<Char>, Char> |
| Name |
|---|
format |
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
/* implementation-defined */ value,
FormatContext& ctx) const;
Declared in <fmt/format.h>
template<typename Char>
struct formatter<Char*, Char>
: formatter<Char const*, Char>
| Name | Description |
|---|---|
formatter<Char const*, Char> |
| Name |
|---|
format |
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
Char* value,
FormatContext& ctx) const;
Declared in <fmt/format.h>
template<typename Char>
struct formatter<void*, Char>
: formatter<void const*, Char>
| Name | Description |
|---|---|
formatter<void const*, Char> |
| Name |
|---|
format |
Declared in <fmt/format.h>
template<typename FormatContext>
constexpr
decltype()
format(
void* value,
FormatContext& ctx) const;
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>
| Name | Description |
|---|---|
formatter<bool, Char> |
| Name |
|---|
format |
Declared in <fmt/std.h>
template<typename FormatContext>
constexpr
decltype(ctx.out())
format(
BitRef const& v,
FormatContext& ctx) const;
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>;
| Name |
|---|
nonlocking |
| Name | Description |
|---|---|
formatter [constructor] | Default constructor |
format | |
parse |
Declared in <fmt/ranges.h>
using nonlocking = void;
Default constructor
Declared in <fmt/ranges.h>
constexpr
formatter();
Declared in <fmt/ranges.h>
template<typename FormatContext>
constexpr
decltype(ctx.out())
format(
range_type& range,
FormatContext& ctx) const;
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>;
| Name | Description |
|---|---|
formatter [constructor] | Default constructor |
format | |
parse |
Default constructor
Declared in <fmt/ranges.h>
constexpr
formatter();
Declared in <fmt/ranges.h>
template<typename FormatContext>
decltype(ctx.out())
format(
map_type& map,
FormatContext& ctx) const;
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>;
| Name |
|---|
format |
parse |
Declared in <fmt/ranges.h>
template<typename FormatContext>
decltype(ctx.out())
format(
range_type& range,
FormatContext& ctx) const;
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 */
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name |
|---|
format |
parse |
set_debug_format |
Declared in <fmt/base.h>
template<typename FormatContext>
constexpr
decltype(ctx.out())
format(
T const& val,
FormatContext& ctx) const;
Declared in <fmt/base.h>
template</* implementation-defined */ U = TYPE>
constexpr
void
set_debug_format(bool set = true);
Declared in <fmt/ranges.h>
template<
typename T,
typename Char>
requires conjunction<is_container_adaptor<T>,
bool_constant<range_format_kind<T, Char>::value ==
range_format::disabled>>::value
struct formatter<T, Char>
: formatter</* implementation-defined */, Char>
| Name | Description |
|---|---|
formatter</* implementation-defined */, Char> |
| Name |
|---|
all |
| Name |
|---|
format |
Declared in <fmt/ranges.h>
using all = /* implementation-defined */;
Declared in <fmt/ranges.h>
template<typename FormatContext>
decltype(ctx.out())
format(
T const& value,
FormatContext& ctx) const;
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>;
| Name | Description |
|---|---|
formatter [constructor] | Default constructor |
format | |
parse | |
set_brackets | |
set_separator |
Default constructor
Declared in <fmt/ranges.h>
constexpr
formatter();
Declared in <fmt/ranges.h>
template<typename FormatContext>
decltype(ctx.out())
format(
Tuple const& value,
FormatContext& ctx) const;
Declared in <fmt/ranges.h>
constexpr
void
set_brackets(
basic_string_view<Char> open,
basic_string_view<Char> close);
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>;
| Name |
|---|
format |
parse |
Declared in <fmt/std.h>
template<typename FormatContext>
constexpr
decltype(ctx.out())
format(
Variant const& value,
FormatContext& ctx) const;
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>
| Name | Description |
|---|---|
formatter<T, Char> |
| Name |
|---|
format |
Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::atomic<T> const& v,
FormatContext& ctx) const;
Declared in <fmt/std.h>
template<
size_t N,
typename Char>
struct formatter<std::bitset<N>, Char>
: nested_formatter<basic_string_view<Char>, Char>
| Name | Description |
|---|---|
nested_formatter<basic_string_view<Char>, Char> |
| Name |
|---|
format |
nested |
parse |
write_padded |
Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::bitset<N> const& bs,
FormatContext& ctx) const;
Declared in <fmt/std.h>
template<
typename T,
typename Char>
struct formatter<std::complex<T>, Char>;
| Name |
|---|
format |
parse |
Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::complex<T> const& c,
FormatContext& ctx) const;
Declared in <fmt/chrono.h>
template<
typename Duration,
typename Char>
struct formatter<local_time<Duration>, Char>;
| Name |
|---|
format |
parse |
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
local_time<Duration> val,
FormatContext& ctx) const;
Declared in <fmt/format.h>
template<
typename T,
typename Char>
struct formatter<nested_view<T, Char>, Char>;
| Name |
|---|
format |
parse |
Declared in <fmt/format.h>
template<typename FormatContext>
decltype(ctx.out())
format(
nested_view<T, Char> view,
FormatContext& ctx) const;
Declared in <fmt/std.h>
template<
typename T,
typename Char>
requires is_formattable<T, Char>::value
struct formatter<std::optional<T>, Char>;
| Name |
|---|
format |
parse |
Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::optional<T> const& opt,
FormatContext& ctx) const;
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>
| Name | Description |
|---|---|
formatter<remove_cvref_t<T>, Char> |
| Name |
|---|
format |
Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::reference_wrapper<T> ref,
FormatContext& ctx) const;
Declared in <fmt/ostream.h>
template<
typename T,
typename Char>
struct formatter</* implementation-defined */, Char>
: basic_ostream_formatter<Char>
| Name | Description |
|---|---|
basic_ostream_formatter<Char> |
| Name |
|---|
format |
set_debug_format [deleted] |
Declared in <fmt/ostream.h>
template<typename Context>
decltype(ctx.out())
format(
/* implementation-defined */ view,
Context& ctx) const;
Declared in <fmt/ostream.h>
template<
typename T,
typename Context>
decltype(ctx.out())
format(
T const& value,
Context& ctx) const;
Declared in <fmt/color.h>
template<
typename T,
typename Char>
struct formatter</* implementation-defined */, Char>
: formatter<T, Char>
| Name | Description |
|---|---|
formatter<T, Char> |
| Name |
|---|
format |
Declared in <fmt/color.h>
template<typename FormatContext>
constexpr
decltype(ctx.out())
format(
/* implementation-defined */ const& arg,
FormatContext& ctx) const;
Declared in <fmt/chrono.h>
template<
typename Char,
typename Duration>
struct formatter<sys_time<Duration>, Char>;
| Name |
|---|
format |
parse |
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
sys_time<Duration> val,
FormatContext& ctx) const;
Declared in <fmt/ranges.h>
template<
typename Tuple,
typename Char>
requires is_tuple_like<Tuple>::value
struct formatter<tuple_join_view<Tuple, Char>, Char>;
| Name |
|---|
format |
parse |
Declared in <fmt/ranges.h>
template<typename FormatContext>
constexpr
FormatContext::iterator
format(
tuple_join_view<Tuple, Char> const& value,
FormatContext& ctx) const;
Declared in <fmt/std.h>
template<
int N,
typename Char>
struct formatter</* implementation-defined */, Char>
: formatter<long long, Char>
| Name | Description |
|---|---|
formatter<long long, Char> |
| Name |
|---|
format |
| Name |
|---|
format_as |
Declared in <fmt/std.h>
template<typename Context>
decltype(ctx.out())
format(
/* implementation-defined */ x,
Context& ctx) const;
Declared in <fmt/std.h>
template<
typename E,
typename Char>
requires is_formattable<E, Char>::value
struct formatter<std::unexpected<E>, Char>;
| Name |
|---|
format |
parse |
Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::unexpected<E> const& value,
FormatContext& ctx) const;
Declared in <fmt/chrono.h>
template<
typename Duration,
typename Char>
struct formatter<utc_time<Duration>, Char>
: formatter<sys_time<Duration>, Char>
| Name | Description |
|---|---|
formatter<sys_time<Duration>, Char> |
| Name |
|---|
format |
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
utc_time<Duration> val,
FormatContext& ctx) const;
Declared in <fmt/format.h>
template<
typename Char,
size_t N>
struct formatter<Char[N], Char>
: formatter<basic_string_view<Char>, Char>
| Name | Description |
|---|---|
formatter<basic_string_view<Char>, Char> |
Declared in <fmt/format.h>
template<
typename Char,
typename Traits,
typename Allocator>
class formatter<std::basic_string<Char, Traits, Allocator>, Char>
: public formatter<basic_string_view<Char>, Char>
| Name | Description |
|---|---|
formatter<basic_string_view<Char>, Char> |
Declared in <fmt/chrono.h>
template<
typename Rep,
typename Period,
typename Char>
struct formatter<std::chrono::duration<Rep, Period>, Char>;
| Name |
|---|
format |
parse |
Declared in <fmt/chrono.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::chrono::duration<Rep, Period> d,
FormatContext& ctx) const;
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>;
| Name |
|---|
format |
parse |
Declared in <fmt/std.h>
template<typename FormatContext>
decltype(ctx.out())
format(
std::expected<T, E> const& value,
FormatContext& ctx) const;
Declared in <fmt/ranges.h>
template<
typename It,
typename Sentinel,
typename Char>
struct formatter<join_view<It, Sentinel, Char>, Char>;
| Name |
|---|
nonlocking |
| Name |
|---|
format |
parse |
Declared in <fmt/ranges.h>
using nonlocking = void;
Declared in <fmt/ranges.h>
template<typename FormatContext>
constexpr
decltype(ctx.out())
format(
view& value,
FormatContext& ctx) const;
Declared in <fmt/format.h>
template<
typename T,
typename Char>
struct formatter<T, Char, void_t</* implementation-defined */>>
: formatter</* implementation-defined */, Char>
| Name | Description |
|---|---|
formatter</* implementation-defined */, Char> |
| Name |
|---|
format |
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.
Declared in <fmt/base.h>
template<typename... T>
struct fstring;
| Name |
|---|
t |
| Name | Description |
|---|---|
fstring [constructor] | Constructors |
get | |
operator string_view const& | Conversion to string_view |
| Name |
|---|
str |
Constructors
Declared in <fmt/base.h>
Construct from runtime_format_string
fstring(runtime_format_string<> fmt);
» more...
Construct from S
template<typename S>
[[always_inline]]
fstring(S const& value);
» more...
Construct from S
template<typename S>
[[always_inline]]
consteval
fstring(S const& s);
» more...
Construct from char
template<size_t N>
[[always_inline]]
consteval
fstring(char const(& s)[N]);
» more...
Construct from runtime_format_string
| Name | Description |
|---|---|
| fmt | The object to construct from |
Construct from S
Declared in <fmt/base.h>
template<typename S>
[[always_inline]]
fstring(S const& value);
| Name | Description |
|---|---|
| value | The object to copy construct from |
Construct from S
Declared in <fmt/base.h>
template<typename S>
[[always_inline]]
consteval
fstring(S const& s);
| Name | Description |
|---|---|
| s | The object to copy construct from |
Construct from char
Declared in <fmt/base.h>
template<size_t N>
[[always_inline]]
consteval
fstring(char const(& s)[N]);
| Name | Description |
|---|---|
| s | The value to construct from |
Conversion to string_view
The object converted to string_view
Declared in <fmt/format.h>
template<
typename OutputIt,
typename Char>
class generic_context;
| Name |
|---|
char_type |
iterator |
| Name |
|---|
Unnamed enum |
| Name | Description |
|---|---|
generic_context [constructor] [deleted] | Constructors |
operator= [deleted] | |
advance_to | |
arg | |
arg_id | |
locale | |
out |
Declared in <fmt/format.h>
using char_type = Char;
Declared in <fmt/format.h>
using iterator = OutputIt;
Declared in <fmt/format.h>
enum Unnamed enum;
| Name |
|---|
builtin_types |
Constructors
Declared in <fmt/format.h>
Copy constructor
generic_context(generic_context const& other) = delete;
» more...
Move constructor
generic_context(generic_context&& other) = default;
» more...
constexpr
generic_context(
OutputIt out,
basic_format_args<generic_context> args,
locale_ref loc = {});
» more...
Copy constructor
| Name | Description |
|---|---|
| other | The object to copy construct from |
Move constructor
| Name | Description |
|---|---|
| other | The object to move construct from |
Declared in <fmt/format.h>
constexpr
generic_context(
OutputIt out,
basic_format_args<generic_context> args,
locale_ref loc = {});
Declared in <fmt/format.h>
constexpr
basic_format_arg<generic_context>
arg(int id) const;
» more...
basic_format_arg<generic_context>
arg(basic_string_view<Char> name) const;
» more...
Declared in <fmt/format.h>
basic_format_arg<generic_context>
arg(basic_string_view<Char> name) const;
Declared in <fmt/format.h>
template<typename T>
struct group_digits_view;
| Name |
|---|
value |
| Name | Description |
|---|---|
group_digits | Returns a view that formats an integer value using ',' as a locale-independent thousands separator. |
Declared in <fmt/format.h>
T value;
Declared in <fmt/compile.h>
template<typename S>
struct is_compiled_string
: std::is_base_of<compiled_string, S>
| Name | Description |
|---|---|
std::is_base_of<compiled_string, S> |
Specifies if T is a container adaptor (like std::stack) that should be formatted as the underlying container.
Declared in <fmt/ranges.h>
template<typename T>
struct is_container_adaptor;
| Name |
|---|
value |
Declared in <fmt/ranges.h>
inline constexpr static
bool value = !std::is_void<decltype(check<T>(nullptr))>::value;
Declared in <fmt/base.h>
template<typename T>
struct is_contiguous
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
Declared in <fmt/format.h>
template<
typename T,
size_t SIZE,
typename Allocator>
struct is_contiguous<basic_memory_buffer<T, SIZE, Allocator>>
: std::true_type
| Name | Description |
|---|---|
std::true_type |
Declared in <fmt/format.h>
template<
typename Char,
typename Traits,
typename Allocator>
struct is_contiguous<std::basic_string<Char, Traits, Allocator>>
: std::true_type
| Name | Description |
|---|---|
std::true_type |
Declared in <fmt/ranges.h>
template<
typename T,
typename Char>
struct is_range;
| Name |
|---|
value |
Declared in <fmt/ranges.h>
inline constexpr static
bool value = detail::is_range_<T>::value &&
!detail::is_optional_like_<T>::value &&
!detail::has_to_string_view<T>::value;
Declared in <fmt/ranges.h>
template<
typename T,
typename C>
struct is_tuple_formattable;
| Name |
|---|
value |
Declared in <fmt/ranges.h>
inline constexpr static
bool value = detail::is_tuple_formattable_<T, C>::value;
Declared in <fmt/ranges.h>
template<typename T>
struct is_tuple_like;
| Name |
|---|
value |
Declared in <fmt/ranges.h>
inline constexpr static
bool value = detail::is_tuple_like_<T>::value && !detail::is_range_<T>::value;
Declared in <fmt/std.h>
template<typename T>
struct is_tuple_like<std::complex<T>>
: std::false_type
| Name | Description |
|---|---|
std::false_type |
Declared in <fmt/std.h>
template<typename T>
struct is_variant_like;
| Name |
|---|
value |
Declared in <fmt/std.h>
inline constexpr static
bool value = detail::is_variant_like_<T>::value;
Declared in <fmt/ranges.h>
template<
typename It,
typename Sentinel,
typename Char = char>
struct join_view
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name |
|---|
join_view [constructor] |
| Name |
|---|
begin |
end |
sep |
Declared in <fmt/ranges.h>
constexpr
join_view(
It b,
Sentinel e,
basic_string_view<Char> s);
Declared in <fmt/ranges.h>
It begin;
Declared in <fmt/ranges.h>
Sentinel end;
Declared in <fmt/format.h>
class loc_value;
| Name | Description |
|---|---|
loc_value [constructor] | Constructors |
visit |
Constructors
Construct from T
Declared in <fmt/format.h>
template<typename T>
loc_value(T value);
| Name | Description |
|---|---|
| value | The object to construct from |
Construct from T
Declared in <fmt/format.h>
template<typename T>
loc_value(T value);
| Name | Description |
|---|---|
| value | The object to construct from |
Declared in <fmt/format.h>
template<typename Visitor>
decltype(vis(0))
visit(Visitor&& vis);
Declared in <fmt/base.h>
class locale_ref;
| Name | Description |
|---|---|
locale_ref [constructor] | Constructors |
get | |
operator bool | Conversion to bool |
Constructors
Declared in <fmt/base.h>
Default constructor
constexpr
locale_ref();
» more...
Construct from Locale
template<typename Locale>
locale_ref(Locale const& loc);
» more...
Default constructor
Declared in <fmt/base.h>
constexpr
locale_ref();
Construct from Locale
Declared in <fmt/base.h>
template<typename Locale>
locale_ref(Locale const& loc);
| Name | Description |
|---|---|
| loc | The object to copy construct from |
Declared in <fmt/base.h>
template<typename Locale>
Locale
get() const;
Conversion to bool
Declared in <fmt/base.h>
explicit
operator bool() const noexcept;
The object converted to bool
Declared in <fmt/base.h>
template<
typename T,
typename Enable = void>
struct locking
: std::false_type
| Name | Description |
|---|---|
std::false_type |
Declared in <fmt/base.h>
struct monostate;
| Name | Description |
|---|---|
monostate [constructor] | Default constructor |
Default constructor
Declared in <fmt/base.h>
constexpr
monostate();
Declared in <fmt/format.h>
template<
typename T,
typename Char = char>
struct nested_formatter;
| Name | Description |
|---|---|
nested_formatter [constructor] | Default constructor |
nested | |
parse | |
write_padded |
| Name | Description |
|---|---|
formatter<std::bitset<N>, Char> |
Default constructor
Declared in <fmt/format.h>
constexpr
nested_formatter();
Declared in <fmt/format.h>
template<
typename FormatContext,
typename F>
decltype(ctx.out())
write_padded(
FormatContext& ctx,
F write) const;
Declared in <fmt/format.h>
template<
typename T,
typename Char>
struct nested_view;
| Name |
|---|
fmt |
value |
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.
Declared in <fmt/base.h>
template<typename Char = char>
class parse_context;
| Name |
|---|
char_type |
iterator |
| 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. |
Declared in <fmt/base.h>
using char_type = Char;
Declared in <fmt/base.h>
using iterator = Char const*;
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.
Returns 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.
Declared in <fmt/base.h>
Reports an error if using the automatic argument indexing; otherwise switches to the manual indexing.
constexpr
void
check_arg_id(int id);
» more...
constexpr
void
check_arg_id(basic_string_view<Char>);
» more...
Reports an error if using the automatic argument indexing; otherwise switches to the manual indexing.
Declared in <fmt/base.h>
constexpr
void
check_arg_id(int id);
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.
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.
Declared in <fmt/base.h>
constexpr
int
next_arg_id();
| Name |
|---|
char_type |
iterator |
| Name |
|---|
parse_context [constructor] |
advance_to |
begin |
check_arg_id |
check_dynamic_spec |
end |
next_arg_id |
Declared in <fmt/base.h>
using char_type = char;
Declared in <fmt/base.h>
using iterator = char const*;
Declared in <fmt/base.h>
constexpr
explicit
parse_context(
basic_string_view<char> fmt,
int next_arg_id = 0);
Declared in <fmt/base.h>
constexpr
void
check_arg_id(int id);
» more...
constexpr
void
check_arg_id(basic_string_view<char>);
» more...
Declared in <fmt/base.h>
constexpr
void
check_arg_id(int id);
Declared in <fmt/base.h>
constexpr
void
check_dynamic_spec(int arg_id);
Declared in <fmt/base.h>
constexpr
int
next_arg_id();
Declared in <fmt/std.h>
class path
: public std::filesystem::path
| Name | Description |
|---|---|
std::filesystem::path |
| Name |
|---|
iterator |
| Name |
|---|
const_iterator |
string_type |
value_type |
| Name | Description |
|---|---|
format | path::format is ignored in this implementation |
| Name | Description |
|---|---|
operator= | Assignment operators |
append | |
assign | |
begin | |
c_str | |
clear | |
compare | |
concat | |
display_string | |
empty | |
end | |
extension | |
filename | |
generic_display_string | |
generic_string | |
generic_system_string | |
generic_u16string | |
generic_u32string | |
generic_u8string | |
generic_wstring | |
has_extension | |
has_filename | |
has_parent_path | |
has_relative_path | |
has_root_directory | |
has_root_name | |
has_root_path | |
has_stem | |
is_absolute | |
is_relative | |
lexically_normal | |
lexically_proximate | |
lexically_relative | |
make_preferred | |
native | |
operator+= | Addition assignment operators |
operator/= | Division assignment operators |
parent_path | |
relative_path | |
remove_filename | |
replace_extension | |
replace_filename | |
root_directory | |
root_name | |
root_path | |
stem | |
string | |
swap | |
system_string | |
u16string | |
u32string | |
u8string | |
wstring | |
operator string_type | Conversion to string_type |
| Name |
|---|
preferred_separator |
Declared in <bits/fs_path.h>
using const_iterator = iterator;
Declared in <bits/fs_path.h>
using string_type = std::basic_string<value_type>;
Declared in <bits/fs_path.h>
using value_type = char;
Declared in <bits/fs_path.h>
class iterator;
| Name | Description |
|---|---|
std::filesystem::__path_iter_advance | |
std::filesystem::__path_iter_distance | |
std::filesystem::path | |
std::filesystem::operator!= | |
std::filesystem::operator== |
path::format is ignored in this implementation
Declared in <bits/fs_path.h>
enum format : unsigned char;
Assignment operators
Declared in <bits/fs_path.h>
path&
operator=(path const& value);
Declared in <bits/fs_path.h>
path&
operator=(path&& value) noexcept;
Declared in <bits/fs_path.h>
path&
operator=(string_type&& __source);
Declared in <bits/fs_path.h>
template<typename _Source>
__detail::_Path<_Source>&
operator=(_Source const& __source);
Declared in <bits/fs_path.h>
template<typename _Source>
__detail::_Path<_Source>&
append(_Source const& __source);
Declared in <bits/fs_path.h>
template<typename _InputIterator>
__detail::_Path2<_InputIterator>&
append(
_InputIterator __first,
_InputIterator __last);
Declared in <bits/fs_path.h>
path&
assign(string_type&& __source);
» more...
template<typename _Source>
__detail::_Path<_Source>&
assign(_Source const& __source);
» more...
template<typename _InputIterator>
__detail::_Path2<_InputIterator>&
assign(
_InputIterator __first,
_InputIterator __last);
» more...
Declared in <bits/fs_path.h>
path&
assign(string_type&& __source);
Declared in <bits/fs_path.h>
template<typename _Source>
__detail::_Path<_Source>&
assign(_Source const& __source);
Declared in <bits/fs_path.h>
template<typename _InputIterator>
__detail::_Path2<_InputIterator>&
assign(
_InputIterator __first,
_InputIterator __last);
Declared in <bits/fs_path.h>
iterator
begin() const noexcept;
Declared in <bits/fs_path.h>
value_type const*
c_str() const noexcept;
Declared in <bits/fs_path.h>
void
clear() noexcept;
Declared in <bits/fs_path.h>
int
compare(basic_string_view<value_type> __s) const noexcept;
Declared in <bits/fs_path.h>
int
compare(path const& __p) const noexcept;
Declared in <bits/fs_path.h>
int
compare(string_type const& __s) const noexcept;
Declared in <bits/fs_path.h>
int
compare(value_type const* __s) const noexcept;
Declared in <bits/fs_path.h>
template<typename _Source>
__detail::_Path<_Source>&
concat(_Source const& __x);
Declared in <bits/fs_path.h>
template<typename _InputIterator>
__detail::_Path2<_InputIterator>&
concat(
_InputIterator __first,
_InputIterator __last);
Declared in <fmt/std.h>
std::string
display_string() const;
Declared in <bits/fs_path.h>
[[nodiscard]]
bool
empty() const noexcept;
Declared in <bits/fs_path.h>
iterator
end() const noexcept;
Declared in <bits/fs_path.h>
path
extension() const;
Declared in <bits/fs_path.h>
path
filename() const;
Declared in <fmt/std.h>
std::string
generic_display_string() const;
Declared in <bits/fs_path.h>
std::string
generic_string() const;
» more...
template<
typename _CharT,
typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>>
std::basic_string<_CharT, _Traits, _Allocator>
generic_string(_Allocator const& __a = _Allocator()) const;
» more...
Declared in <bits/fs_path.h>
std::string
generic_string() const;
Declared in <bits/fs_path.h>
template<
typename _CharT,
typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>>
std::basic_string<_CharT, _Traits, _Allocator>
generic_string(_Allocator const& __a = _Allocator()) const;
Declared in <fmt/std.h>
std::string
generic_system_string() const;
Declared in <bits/fs_path.h>
std::u16string
generic_u16string() const;
Declared in <bits/fs_path.h>
std::u32string
generic_u32string() const;
Declared in <bits/fs_path.h>
[[__abi_tag__]]
std::u8string
generic_u8string() const;
Declared in <bits/fs_path.h>
std::wstring
generic_wstring() const;
Declared in <bits/fs_path.h>
bool
has_extension() const noexcept;
Declared in <bits/fs_path.h>
bool
has_filename() const noexcept;
Declared in <bits/fs_path.h>
bool
has_parent_path() const noexcept;
Declared in <bits/fs_path.h>
bool
has_relative_path() const noexcept;
Declared in <bits/fs_path.h>
bool
has_root_directory() const noexcept;
Declared in <bits/fs_path.h>
bool
has_root_name() const noexcept;
Declared in <bits/fs_path.h>
bool
has_root_path() const noexcept;
Declared in <bits/fs_path.h>
bool
has_stem() const noexcept;
Declared in <bits/fs_path.h>
bool
is_absolute() const noexcept;
Declared in <bits/fs_path.h>
bool
is_relative() const noexcept;
Declared in <bits/fs_path.h>
path
lexically_normal() const;
Declared in <bits/fs_path.h>
path
lexically_proximate(path const& base) const;
Declared in <bits/fs_path.h>
path
lexically_relative(path const& base) const;
Declared in <bits/fs_path.h>
path&
make_preferred();
Declared in <bits/fs_path.h>
string_type const&
native() const noexcept;
Addition assignment operators
Declared in <bits/fs_path.h>
path&
operator+=(value_type __x);
» more...
path&
operator+=(basic_string_view<value_type> __x);
» more...
path&
operator+=(path const& __x);
» more...
path&
operator+=(string_type const& __x);
» more...
path&
operator+=(value_type const* __x);
» more...
template<typename _CharT>
__detail::_Path2<_CharT*>&
operator+=(_CharT __x);
» more...
template<typename _Source>
__detail::_Path<_Source>&
operator+=(_Source const& __x);
» more...
Declared in <bits/fs_path.h>
path&
operator+=(value_type __x);
Declared in <bits/fs_path.h>
path&
operator+=(basic_string_view<value_type> __x);
Declared in <bits/fs_path.h>
path&
operator+=(path const& __x);
Declared in <bits/fs_path.h>
path&
operator+=(string_type const& __x);
Declared in <bits/fs_path.h>
path&
operator+=(value_type const* __x);
Declared in <bits/fs_path.h>
template<typename _CharT>
__detail::_Path2<_CharT*>&
operator+=(_CharT __x);
Declared in <bits/fs_path.h>
template<typename _Source>
__detail::_Path<_Source>&
operator+=(_Source const& __x);
Division assignment operators
Declared in <bits/fs_path.h>
path&
operator/=(path const& __p);
» more...
template<typename _Source>
__detail::_Path<_Source>&
operator/=(_Source const& __source);
» more...
Declared in <bits/fs_path.h>
path&
operator/=(path const& __p);
Declared in <bits/fs_path.h>
template<typename _Source>
__detail::_Path<_Source>&
operator/=(_Source const& __source);
Declared in <bits/fs_path.h>
path
parent_path() const;
Declared in <bits/fs_path.h>
path
relative_path() const;
Declared in <bits/fs_path.h>
path&
remove_filename();
Declared in <bits/fs_path.h>
path&
replace_extension(path const& __replacement = path());
Declared in <bits/fs_path.h>
path&
replace_filename(path const& __replacement);
Declared in <bits/fs_path.h>
path
root_directory() const;
Declared in <bits/fs_path.h>
path
root_name() const;
Declared in <bits/fs_path.h>
path
root_path() const;
Declared in <bits/fs_path.h>
path
stem() const;
Declared in <bits/fs_path.h>
std::string
string() const;
» more...
template<
typename _CharT,
typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>>
std::basic_string<_CharT, _Traits, _Allocator>
string(_Allocator const& __a = _Allocator()) const;
» more...
Declared in <bits/fs_path.h>
std::string
string() const;
Declared in <bits/fs_path.h>
template<
typename _CharT,
typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>>
std::basic_string<_CharT, _Traits, _Allocator>
string(_Allocator const& __a = _Allocator()) const;
Declared in <bits/fs_path.h>
void
swap(path& __rhs) noexcept;
Declared in <fmt/std.h>
std::string
system_string() const;
Declared in <bits/fs_path.h>
std::u16string
u16string() const;
Declared in <bits/fs_path.h>
std::u32string
u32string() const;
Declared in <bits/fs_path.h>
[[__abi_tag__]]
std::u8string
u8string() const;
Declared in <bits/fs_path.h>
std::wstring
wstring() const;
Conversion to string_type
Declared in <bits/fs_path.h>
operator string_type() const;
The object converted to string_type
Declared in <bits/fs_path.h>
inline constexpr static
value_type preferred_separator = '/';
Declared in <fmt/ranges.h>
template<
typename T,
typename Char,
typename Enable = void>
struct range_format_kind
: conditional_t<is_range<T, Char>::value, /* implementation-defined */, std::integral_constant<range_format, range_format::disabled>>
Declared in <fmt/ranges.h>
template<
typename T,
typename Char,
typename Enable = void>
struct range_formatter;
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>;
| Name | Description |
|---|---|
range_formatter [constructor] | Default constructor |
format | |
parse | |
set_brackets | |
set_separator | |
underlying |
Default constructor
Declared in <fmt/ranges.h>
constexpr
range_formatter();
Declared in <fmt/ranges.h>
template<
typename R,
typename FormatContext>
constexpr
decltype(ctx.out())
format(
R&& range,
FormatContext& ctx) const;
Declared in <fmt/ranges.h>
constexpr
void
set_brackets(
basic_string_view<Char> open,
basic_string_view<Char> close);
Declared in <fmt/ranges.h>
constexpr
/* implementation-defined */&
underlying();
Declared in <fmt/color.h>
struct rgb;
| Name | Description |
|---|---|
rgb [constructor] | Constructors |
| Name |
|---|
b |
g |
r |
Constructors
Default constructor
Declared in <fmt/color.h>
constexpr
rgb();
Construct from color
| Name | Description |
|---|---|
| hex | The object to construct from |
Construct from uint32_t
Declared in <fmt/color.h>
constexpr
rgb(uint32_t hex);
| Name | Description |
|---|---|
| hex | The object to construct from |
Declared in <fmt/color.h>
constexpr
rgb(
uint8_t r_,
uint8_t g_,
uint8_t b_);
Declared in <fmt/color.h>
uint8_t b;
Declared in <fmt/color.h>
uint8_t g;
Declared in <fmt/color.h>
uint8_t r;
Declared in <fmt/base.h>
template<typename Char = char>
struct runtime_format_string;
| Name |
|---|
str |
| Name | Description |
|---|---|
runtime | Creates a runtime format string. |
Declared in <fmt/compile.h>
template<size_t N>
class static_format_result;
| Name |
|---|
static_format_result [constructor] |
c_str |
str |
Declared in <fmt/compile.h>
template<
typename S,
typename... T>
constexpr
explicit
static_format_result(
S const& fmt,
T&&... args);
Declared in <fmt/compile.h>
constexpr
char const*
c_str() const;
Declared in <fmt/format.h>
class string_buffer;
| Name | Description |
|---|---|
string_buffer [constructor] | Default constructor |
str | |
operator writer | Conversion to writer |
Default constructor
Declared in <fmt/format.h>
string_buffer();
Declared in <fmt/format.h>
std::string&
str();
Conversion to writer
The object converted to writer
A text style consisting of foreground and background colors and emphasis.
Declared in <fmt/color.h>
class text_style;
| Name | Description |
|---|---|
text_style [constructor] | Default constructor |
get_background | |
get_emphasis | |
get_foreground | |
has_background | |
has_emphasis | |
has_foreground | |
operator|= | Bitwise disjunction assignment operator |
operator== | Equality operator |
operator!= | Inequality operator |
| Name | Description |
|---|---|
fmt::bg | Creates a text style from the background color. |
fmt::fg | Creates a text style from the foreground (text) color. |
fmt::operator| | Bitwise disjunction operator |
| Name | Description |
|---|---|
format | Formats arguments and returns the result as a string using ANSI escape sequences to specify text formatting. |
operator| | Bitwise disjunction operator |
print | Formats a string and prints it to stdout using ANSI escape sequences to specify text formatting. |
println | Formats a string and prints it to stdout followed by a newline, using ANSI escape sequences to specify text formatting. |
Default constructor
| Name | Description |
|---|---|
| em | The object to construct from |
Declared in <fmt/color.h>
constexpr
/* implementation-defined */
get_background() const noexcept;
Declared in <fmt/color.h>
constexpr
/* implementation-defined */
get_foreground() const noexcept;
Declared in <fmt/color.h>
constexpr
bool
has_background() const noexcept;
Declared in <fmt/color.h>
constexpr
bool
has_emphasis() const noexcept;
Declared in <fmt/color.h>
constexpr
bool
has_foreground() const noexcept;
Bitwise disjunction assignment operator
Reference to the current object
| Name | Description |
|---|---|
| rhs | The right operand |
Equality operator
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| rhs | The right operand |
Inequality operator
true if the objects are not equal, false otherwise
| Name | Description |
|---|---|
| rhs | The right operand |
Declared in <fmt/ranges.h>
template<
typename Tuple,
typename Char>
struct tuple_join_view
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name | Description |
|---|---|
tuple_join_view [constructor] | Constructor |
| Name |
|---|
sep |
tuple |
| Name | Description |
|---|---|
join | Returns an object that formats std::tuple with elements separated by sep. |
Constructor
Declared in <fmt/ranges.h>
constexpr
tuple_join_view(
Tuple const& t,
basic_string_view<Char> s);
| Name | Description |
|---|---|
| t | The object to copy construct from |
| s | An implementation of std::basic_string_view for pre-C++17 providing a subset of the API. fmt::basic_string_view is used in the public API 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). |
Declared in <fmt/ranges.h>
Tuple const& tuple;
Declared in <fmt/printf.h>
template<typename Char>
struct vprintf_args;
| Name |
|---|
type |
Declared in <fmt/format.h>
class writer;
| Name | Description |
|---|---|
writer [constructor] | Constructors |
print | Formats args according to specifications in fmt and writes the output to the file. |
Constructors
Construct from buffer
Declared in <fmt/format.h>
writer(/* implementation-defined */& buf);
| Name | Description |
|---|---|
| buf | The object to copy construct from |
Construct from FILE
Declared in <fmt/format.h>
writer(FILE* f);
| Name | Description |
|---|---|
| f | The object to construct from |
Formats args according to specifications in fmt and writes the output to the file.
Declared in <fmt/format.h>
template<typename... T>
void
print(
format_string<T...> fmt,
T&&... args);
Declared in <fmt/format.h>
enum Unnamed enum;
| Name |
|---|
inline_buffer_size |
Declared in <fmt/base.h>
enum class align : int;
| Name |
|---|
none |
left |
right |
center |
numeric |
Declared in <fmt/base.h>
enum class arg_id_kind : int;
| Name |
|---|
none |
index |
name |
Declared in <fmt/color.h>
enum class color : uint32_t;
| Name |
|---|
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 |
Declared in <fmt/color.h>
enum class emphasis : uint8_t;
| Name |
|---|
bold |
faint |
italic |
underline |
blink |
reverse |
conceal |
strikethrough |
| Name | Description |
|---|---|
operator| | Bitwise disjunction operator |
Declared in <fmt/base.h>
enum class presentation_type : unsigned char;
| Name |
|---|
none |
debug |
string |
dec |
hex |
oct |
bin |
chr |
pointer |
exp |
fixed |
general |
hexfloat |
Declared in <fmt/ranges.h>
enum class range_format : int;
| Name |
|---|
disabled |
map |
set |
sequence |
string |
debug_string |
Declared in <fmt/base.h>
enum class sign : int;
| Name |
|---|
none |
minus |
plus |
space |
Declared in <fmt/color.h>
enum class terminal_color : uint8_t;
| Name |
|---|
black |
red |
green |
yellow |
blue |
magenta |
cyan |
white |
bright_black |
bright_red |
bright_green |
bright_yellow |
bright_blue |
bright_magenta |
bright_cyan |
bright_white |
User-defined literal equivalent of fmt::arg, but with compile-time checks.
Declared in <fmt/compile.h>
User-defined literal equivalent of fmt::arg, but with compile-time checks.
template</* implementation-defined */ S>
constexpr
auto
Unnamed function();
» more...
template</* implementation-defined */ Str>
constexpr
auto
Unnamed function();
» more...
User-defined literal equivalent of fmt::arg, but with compile-time checks.
Declared in <fmt/format.h>
template</* implementation-defined */ S>
constexpr
auto
Unnamed function();
Example:
using namespace fmt::literals; fmt::print("The answer is {answer}.", "answer"_a=42);
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.
Declared in <fmt/base.h>
Returns a named argument to be used in a formatting function. It should only be used in a call to a formatting function.
template<typename T>
named_arg<T>
arg(
char const* name,
T const& arg);
» more...
template<typename T>
named_arg<T, wchar_t>
arg(
wchar_t const* name,
T const& arg);
» more...
Returns a named argument to be used in a formatting function. It should only be used in a call to a formatting function.
Declared in <fmt/base.h>
template<typename T>
named_arg<T>
arg(
char const* name,
T const& arg);
Example:
fmt::print("The answer is {answer}.", fmt::arg("answer", 42));
Named arguments passed with fmt::arg are not supported in compile-time checks, but "answer"_a=42 are compile-time checked in sufficiently new compilers. See operator""_a().
Declared in <fmt/xchar.h>
template<typename T>
named_arg<T, wchar_t>
arg(
wchar_t const* name,
T const& arg);
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.
Declared in <fmt/color.h>
constexpr
text_style
bg(/* implementation-defined */ background) noexcept;
A text style consisting of foreground and background colors and emphasis.
Creates a text style from the foreground (text) color.
Declared in <fmt/color.h>
constexpr
text_style
fg(/* implementation-defined */ foreground) noexcept;
A text style consisting of foreground and background colors and emphasis.
format overloads
Declared in <fmt/color.h>
Formats args according to specifications in fmt and returns the result as a string.
template<typename... T>
[[nodiscard]]
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>
constexpr
std::basic_string<S::char_type>
format(
S const&,
T&&... args);
» more...
template<
typename CompiledFormat,
typename... T,
typename Char = CompiledFormat::char_type>
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>
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.
Declared in <fmt/format.h>
template<typename... T>
[[nodiscard]]
std::string
format(
format_string<T...> fmt,
T&&... args);
Example:
#include <fmt/format.h> std::string message = fmt::format("The answer is {}.", 42);
Declared in <fmt/xchar.h>
template<typename... T>
std::wstring
format(
wformat_string<T...> fmt,
T&&... args);
Declared in <fmt/compile.h>
template<
typename S,
typename... T>
constexpr
std::basic_string<S::char_type>
format(
S const&,
T&&... args);
Declared in <fmt/compile.h>
template<
typename CompiledFormat,
typename... T,
typename Char = CompiledFormat::char_type>
constexpr
std::basic_string<Char>
format(
CompiledFormat const& cf,
T const&... args);
Declared in <fmt/xchar.h>
template<
typename S,
typename... T,
typename Char = /* implementation-defined */>
std::basic_string<Char>
format(
S const& fmt,
T&&... args);
Declared in <fmt/format.h>
template<typename... T>
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.
Declared in <fmt/color.h>
template<typename... T>
std::string
format(
text_style ts,
format_string<T...> fmt,
T&&... args);
Example:
` #include <fmt/color.h> std::string message = fmt::format(fmt::emphasis::bold | fg(fmt::color::red), "The answer is {}", 42); `
| Name | Description |
|---|---|
| ts | A text style consisting of foreground and background colors and emphasis. |
Declared in <fmt/xchar.h>
template<typename... T>
std::wstring
format(
text_style ts,
wformat_string<T...> fmt,
T&&... args);
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:
Declared in <fmt/format.h>
void
format_system_error(
/* implementation-defined */& out,
int error_code,
char const* message) noexcept;
<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.
| 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
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>
format_to_result
format_to(
char(& out)[N],
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>
remove_cvref_t<OutputIt>
format_to(
OutputIt&& out,
format_string<T...> fmt,
T&&... args);
» more...
template<
typename OutputIt,
typename CompiledFormat,
typename... T>
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>
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...
Declared in <fmt/xchar.h>
template<
typename OutputIt,
typename... T>
OutputIt
format_to(
OutputIt out,
wformat_string<T...> fmt,
T&&... args);
Declared in <fmt/base.h>
template<
size_t N,
typename... T>
format_to_result
format_to(
char(& out)[N],
format_string<T...> fmt,
T&&... args);
Formats args according to specifications in fmt, writes the result to the output iterator out and returns the iterator past the end of the output range. format_to does not append a terminating null character.
Declared in <fmt/base.h>
template<
typename OutputIt,
typename... T>
remove_cvref_t<OutputIt>
format_to(
OutputIt&& out,
format_string<T...> fmt,
T&&... args);
Example:
auto out = std::vector<char>(); fmt::format_to(std::back_inserter(out), "{}", 42);
Declared in <fmt/compile.h>
template<
typename OutputIt,
typename CompiledFormat,
typename... T>
constexpr
OutputIt
format_to(
OutputIt out,
CompiledFormat const& cf,
T const&... args);
Declared in <fmt/compile.h>
template<
typename OutputIt,
typename S,
typename... T>
constexpr
OutputIt
format_to(
OutputIt out,
S const&,
T&&... args);
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);
Declared in <fmt/format.h>
template<
typename OutputIt,
typename... T>
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.
Declared in <fmt/color.h>
template<
typename OutputIt,
typename... T>
OutputIt
format_to(
OutputIt out,
text_style ts,
format_string<T...> fmt,
T&&... args);
Example:
std::vector<char> out; fmt::format_to(std::back_inserter(out), fmt::emphasis::bold | fg(fmt::color::red), "{}", 42);
| Name | Description |
|---|---|
| ts | A text style consisting of foreground and background colors and emphasis. |
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.
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>
format_to_n_result<OutputIt>
format_to_n(
OutputIt out,
size_t n,
format_string<T...> fmt,
T&&... args);
» more...
template<
typename OutputIt,
typename... T>
format_to_n_result<OutputIt>
format_to_n(
OutputIt out,
size_t n,
wformat_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.
Declared in <fmt/base.h>
template<
typename OutputIt,
typename... T>
format_to_n_result<OutputIt>
format_to_n(
OutputIt out,
size_t n,
format_string<T...> fmt,
T&&... args);
Declared in <fmt/xchar.h>
template<
typename OutputIt,
typename... T>
format_to_n_result<OutputIt>
format_to_n(
OutputIt out,
size_t n,
wformat_string<T...> fmt,
T&&... args);
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);
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...).
Declared in <fmt/base.h>
Returns the number of chars in the output of format(fmt, args...).
template<typename... T>
[[nodiscard]]
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]]
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...).
Declared in <fmt/base.h>
template<typename... T>
[[nodiscard]]
size_t
formatted_size(
format_string<T...> fmt,
T&&... args);
the number of chars in the output of format(fmt, args...).
Declared in <fmt/compile.h>
template<
typename S,
typename... T>
constexpr
size_t
formatted_size(
S const& fmt,
T&&... args);
Declared in <fmt/xchar.h>
template<
typename S,
typename... T,
typename Char = /* implementation-defined */>
size_t
formatted_size(
S const& fmt,
T&&... args);
Declared in <fmt/format.h>
template<typename... T>
[[nodiscard]]
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.
Declared in <fmt/printf.h>
Formats args according to specifications in fmt and writes the output to f.
template<typename... T>
int
fprintf(
FILE* f,
string_view fmt,
T const&... args);
» more...
template<typename... T>
[[deprecated]]
int
fprintf(
FILE* f,
basic_string_view<wchar_t> fmt,
T const&... args);
» more...
Formats args according to specifications in fmt and writes the output to f.
Declared in <fmt/printf.h>
template<typename... T>
int
fprintf(
FILE* f,
string_view fmt,
T const&... args);
Example:
fmt::fprintf(stderr, "Don't %s!", "panic");
Declared in <fmt/printf.h>
template<typename... T>
[[deprecated]]
int
fprintf(
FILE* f,
basic_string_view<wchar_t> fmt,
T const&... args);
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.
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.
Declared in <fmt/chrono.h>
tm
gmtime(time_t time);
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.
Declared in <fmt/format.h>
template<typename T>
group_digits_view<T>
group_digits(T value);
Example:
fmt::print("{}", fmt::group_digits(12345)); // Output: "12,345"
join overloads
Declared in <fmt/ranges.h>
Returns an object that formats std::initializer_list with elements separated by sep.
template<typename T>
[[deprecated]]
join_view<T const*, T const*>
join(
std::initializer_list<T> list,
string_view sep);
» more...
template<typename T>
[[deprecated]]
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...
Returns a view that formats range with elements separated by sep.
template<typename Range>
constexpr
join_view<decltype(detail::range_begin(r)), decltype(detail::range_end(r))>
join(
Range&& r,
string_view sep);
» more...
template<
typename Tuple,
typename S,
typename Char = ::value_type>
tuple_join_view<Tuple, Char>
join(
Tuple const& tuple,
S&& sep);
» more...
template<
typename Range,
typename S,
typename Char = ::value_type>
join_view<decltype(std::begin(range)), decltype(std::end(range)), Char>
join(
Range&& range,
S&& 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,
typename S,
typename Char = ::value_type>
join_view<It, Sentinel, Char>
join(
It begin,
Sentinel end,
S&& sep);
» more...
Returns an object that formats std::initializer_list with elements separated by sep.
Declared in <fmt/ranges.h>
template<typename T>
[[deprecated]]
join_view<T const*, T const*>
join(
std::initializer_list<T> list,
string_view sep);
Example:
fmt::print("{}", fmt::join({1, 2, 3}, ", ")); // Output: "1, 2, 3"
Declared in <fmt/xchar.h>
template<typename T>
[[deprecated]]
join_view<T const*, T const*, wchar_t>
join(
std::initializer_list<T> list,
wstring_view sep);
Returns an object that formats std::tuple with elements separated by sep.
Declared in <fmt/ranges.h>
template<typename Tuple>
constexpr
tuple_join_view<Tuple, char>
join(
Tuple const& tuple,
string_view sep);
Example:
auto t = std::tuple<int, char>(1, 'a'); fmt::print("{}", fmt::join(t, ", ")); // Output: 1, a
an object that formats std::tuple with elements separated by sep.
Returns a view that formats range with elements separated by sep.
Declared in <fmt/ranges.h>
template<typename Range>
constexpr
join_view<decltype(detail::range_begin(r)), decltype(detail::range_end(r))>
join(
Range&& r,
string_view sep);
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
a view that formats range with elements separated by sep.
Declared in <fmt/xchar.h>
template<
typename Tuple,
typename S,
typename Char = ::value_type>
tuple_join_view<Tuple, Char>
join(
Tuple const& tuple,
S&& sep);
Declared in <fmt/xchar.h>
template<
typename Range,
typename S,
typename Char = ::value_type>
join_view<decltype(std::begin(range)), decltype(std::end(range)), Char>
join(
Range&& range,
S&& sep);
Returns a view that formats the iterator range [begin, end)] with elements separated by sep.
Declared in <fmt/ranges.h>
template<
typename It,
typename Sentinel>
join_view<It, Sentinel>
join(
It begin,
Sentinel end,
string_view sep);
Declared in <fmt/xchar.h>
template<
typename It,
typename Sentinel,
typename S,
typename Char = ::value_type>
join_view<It, Sentinel, Char>
join(
It begin,
Sentinel end,
S&& sep);
Declared in <fmt/base.h>
template<
typename Context = context,
typename... T,
int NUM_ARGS = int(sizeof...(T)),
int NUM_NAMED_ARGS = detail::count_named_args<T...>(),
ullong 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.
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);
Declared in <fmt/xchar.h>
template<typename... T>
constexpr
decltype(fmt::make_format_args<wformat_context>(args...))
make_wformat_args(T&... args);
Declared in <fmt/base.h>
template<typename T>
constexpr
T
max_of(
T a,
T b);
Declared in <fmt/base.h>
template<typename T>
constexpr
T
min_of(
T a,
T b);
Bitwise disjunction operators
Declared in <fmt/color.h>
Bitwise disjunction operator
constexpr
text_style
operator|(
emphasis lhs,
emphasis rhs) noexcept;
» more...
Bitwise disjunction operator
constexpr
text_style
operator|(
text_style lhs,
text_style rhs);
» more...
Bitwise disjunction operator
Declared in <fmt/color.h>
constexpr
text_style
operator|(
emphasis lhs,
emphasis rhs) noexcept;
A text style consisting of foreground and background colors and emphasis.
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Bitwise disjunction operator
A text style consisting of foreground and background colors and emphasis.
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
print overloads
Declared in <fmt/base.h>
Formats args according to specifications in fmt and writes the output to stdout.
template<typename... T>
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...
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>
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...
Formats args according to specifications in fmt and writes the output to stdout.
Declared in <fmt/base.h>
template<typename... T>
void
print(
format_string<T...> fmt,
T&&... args);
Example:
fmt::print("The answer is {}.", 42);
Declared in <fmt/xchar.h>
template<typename... T>
void
print(
wformat_string<T...> fmt,
T&&... args);
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.
Declared in <fmt/color.h>
template<typename... T>
void
print(
text_style ts,
format_string<T...> fmt,
T&&... args);
Example:
fmt::print(fmt::emphasis::bold | fg(fmt::color::red), "Elapsed time: {0:.2f} seconds", 1.23);
| Name | Description |
|---|---|
| ts | A text style consisting of foreground and background colors and emphasis. |
Prints formatted data to the stream os.
Declared in <fmt/ostream.h>
template<typename... T>
void
print(
std::ostream& os,
format_string<T...> fmt,
T&&... args);
Example:
fmt::print(cerr, "Don't {}!", "panic");
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.
Declared in <fmt/base.h>
template<typename... T>
void
print(
FILE* f,
format_string<T...> fmt,
T&&... args);
Example:
fmt::print(stderr, "Don't {}!", "panic");
Declared in <fmt/xchar.h>
template<typename... T>
void
print(
FILE* f,
wformat_string<T...> fmt,
T&&... args);
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.
Declared in <fmt/color.h>
template<typename... T>
void
print(
FILE* f,
text_style ts,
format_string<T...> fmt,
T&&... args);
Example:
fmt::print(fmt::emphasis::bold | fg(fmt::color::red), "Elapsed time: {0:.2f} seconds", 1.23);
| Name | Description |
|---|---|
| ts | A text style consisting of foreground and background colors and emphasis. |
Formats args according to specifications in fmt and writes the output to stdout.
Declared in <fmt/printf.h>
template<typename... T>
int
printf(
string_view fmt,
T const&... args);
Example:
fmt::printf("Elapsed time: %.2f seconds", 1.23);
println overloads
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>
void
println(
format_string<T...> fmt,
T&&... args);
» more...
template<typename... T>
void
println(
wformat_string<T...> fmt,
T&&... args);
» more...
Formats a string and prints it to stdout followed by a newline, using ANSI escape sequences to specify text formatting.
template<typename... T>
void
println(
text_style ts,
format_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>
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 a string and prints it to the specified file stream followed by a newline, using ANSI escape sequences to specify text formatting.
template<typename... T>
void
println(
FILE* f,
text_style ts,
format_string<T...> fmt,
T&&... args);
» more...
Formats args according to specifications in fmt and writes the output to stdout followed by a newline.
Declared in <fmt/base.h>
template<typename... T>
void
println(
format_string<T...> fmt,
T&&... args);
Declared in <fmt/xchar.h>
template<typename... T>
void
println(
wformat_string<T...> fmt,
T&&... args);
Formats a string and prints it to stdout followed by a newline, using ANSI escape sequences to specify text formatting.
Declared in <fmt/color.h>
template<typename... T>
void
println(
text_style ts,
format_string<T...> fmt,
T&&... args);
Example:
fmt::println(fmt::emphasis::bold | fg(fmt::color::red), "Elapsed time: {0:.2f} seconds", 1.23);
| Name | Description |
|---|---|
| ts | A text style consisting of foreground and background colors and emphasis. |
Declared in <fmt/ostream.h>
template<typename... T>
void
println(
std::ostream& os,
format_string<T...> fmt,
T&&... args);
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.
Declared in <fmt/base.h>
template<typename... T>
void
println(
FILE* f,
format_string<T...> fmt,
T&&... args);
Declared in <fmt/xchar.h>
template<typename... T>
void
println(
FILE* f,
wformat_string<T...> fmt,
T&&... args);
Formats a string and prints it to the specified file stream followed by a newline, using ANSI escape sequences to specify text formatting.
Declared in <fmt/color.h>
template<typename... T>
void
println(
FILE* f,
text_style ts,
format_string<T...> fmt,
T&&... args);
Example:
fmt::println(fmt::emphasis::bold | fg(fmt::color::red), "Elapsed time: {0:.2f} seconds", 1.23);
| Name | Description |
|---|---|
| ts | A text style consisting of foreground and background colors and emphasis. |
Converts p to const void* for pointer formatting.
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.
Declared in <fmt/format.h>
template<typename T>
void const*
ptr(T p);
Example:
auto s = fmt::format("{}", fmt::ptr(p));
Declared in <fmt/std.h>
template<typename T>
void const*
ptr(std::shared_ptr<T> const& p);
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.
Declared in <fmt/base.h>
[[noreturn]]
void
report_error(char const* message);
Declared in <fmt/format.h>
void
report_system_error(
int error_code,
char const* message) noexcept;
Creates a runtime format string.
Declared in <fmt/base.h>
Creates a runtime format string.
runtime_format_string<>
runtime(string_view s);
» more...
runtime_format_string<wchar_t>
runtime(wstring_view s);
» more...
Creates a runtime format string.
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 string.
Declared in <fmt/printf.h>
Formats args according to specifications in fmt and returns the result as string.
template<typename... T>
std::string
sprintf(
string_view fmt,
T const&... args);
» more...
template<typename... T>
[[deprecated]]
std::wstring
sprintf(
basic_string_view<wchar_t> fmt,
T const&... args);
» more...
Formats args according to specifications in fmt and returns the result as string.
Declared in <fmt/printf.h>
template<typename... T>
std::string
sprintf(
string_view fmt,
T const&... args);
Example:
std::string message = fmt::sprintf("The answer is %d", 42);
Declared in <fmt/printf.h>
template<typename... T>
[[deprecated]]
std::wstring
sprintf(
basic_string_view<wchar_t> fmt,
T const&... args);
Returns a view that formats value via an ostream operator<<.
Declared in <fmt/ostream.h>
template<typename T>
constexpr
/* implementation-defined */
streamed(T const& value);
Example:
fmt::print("Current thread id: {}n", fmt::streamed(std::this_thread::get_id()));
a view that formats value via an ostream operator<<.
Returns an argument that will be formatted using ANSI escape sequences, to be used in a formatting function.
Declared in <fmt/color.h>
template<typename T>
constexpr
/* implementation-defined */
styled(
T const& value,
text_style ts);
Example:
fmt::print("Elapsed time: {0:.2f} seconds", fmt::styled(1.23, fmt::fg(fmt::color::green) | fmt::bg(fmt::color::blue)));
| Name | Description |
|---|---|
| ts | A text style consisting of foreground and background colors and emphasis. |
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.
Declared in <fmt/format.h>
template<typename... T>
std::system_error
system_error(
int error_code,
format_string<T...> fmt,
T&&... args);
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);
An exception type that includes an error_code value.
Converts value to std::string using the default format for type T.
Declared in <fmt/format.h>
Converts value to std::string using the default format for type T.
template<typename T>
[[nodiscard]]
constexpr
std::string
to_string(T value);
» more...
template<typename T>
[[nodiscard]]
constexpr
std::string
to_string(T const& value);
» more...
template<typename T>
[[nodiscard]]
constexpr
std::string
to_string(T const& value);
» more...
template<size_t SIZE>
[[nodiscard]]
std::string
to_string(basic_memory_buffer<char, SIZE> const& buf);
» more...
Converts value to std::string using the default format for type T.
Declared in <fmt/format.h>
template<typename T>
[[nodiscard]]
constexpr
std::string
to_string(T value);
Example:
std::string answer = fmt::to_string(42);
Declared in <fmt/format.h>
template<typename T>
[[nodiscard]]
constexpr
std::string
to_string(T const& value);
Declared in <fmt/format.h>
template<typename T>
[[nodiscard]]
constexpr
std::string
to_string(T const& value);
Declared in <fmt/format.h>
template<size_t SIZE>
[[nodiscard]]
std::string
to_string(basic_memory_buffer<char, SIZE> const& buf);
Converts value to std::wstring using the default format for type T.
Declared in <fmt/xchar.h>
template<typename T>
std::wstring
to_wstring(T const& value);
Converts e to the underlying type.
Declared in <fmt/format.h>
template<typename Enum>
constexpr
underlying_t<Enum>
underlying(Enum e) noexcept;
Example:
enum class color { red, green, blue }; auto s = fmt::format("{}", fmt::underlying(color::red)); // s == "0"
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...
Declared in <fmt/xchar.h>
template<typename Char>
std::basic_string<Char>
vformat(
basic_string_view<Char> fmt,
basic_format_args<buffered_context<Char>> args);
Declared in <fmt/format.h>
std::string
vformat(
locale_ref loc,
string_view fmt,
format_args args);
Declared in <fmt/color.h>
std::string
vformat(
text_style ts,
string_view fmt,
format_args args);
Declared in <fmt/xchar.h>
std::wstring
vformat(
text_style ts,
wstring_view fmt,
wformat_args args);
Declared in <fmt/xchar.h>
template<
typename S,
typename Char = /* implementation-defined */>
std::basic_string<Char>
vformat(
locale_ref loc,
S const& fmt,
basic_format_args<buffered_context<Char>> args);
vformat_to overloads
Declared in <fmt/base.h>
template<size_t N>
[[deprecated]]
format_to_result
vformat_to(
char(& out)[N],
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...
Declared in <fmt/base.h>
template<size_t N>
[[deprecated]]
format_to_result
vformat_to(
char(& out)[N],
string_view fmt,
format_args args);
Formats a string and writes the output to out.
Declared in <fmt/base.h>
template<typename OutputIt>
remove_cvref_t<OutputIt>
vformat_to(
OutputIt&& out,
string_view fmt,
format_args args);
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);
Declared in <fmt/format.h>
template<typename OutputIt>
OutputIt
vformat_to(
OutputIt out,
locale_ref loc,
string_view fmt,
format_args args);
Formats a string with the given text_style and writes the output to out.
Declared in <fmt/color.h>
template<typename OutputIt>
OutputIt
vformat_to(
OutputIt out,
text_style ts,
string_view fmt,
format_args args);
| Name | Description |
|---|---|
| ts | A text style consisting of foreground and background colors and emphasis. |
Declared in <fmt/xchar.h>
template<
typename S,
typename OutputIt,
typename... Args,
typename Char = /* implementation-defined */>
OutputIt
vformat_to(
OutputIt out,
locale_ref loc,
S const& fmt,
basic_format_args<buffered_context<Char>> args);
Declared in <fmt/base.h>
template<
typename OutputIt,
typename... T>
format_to_n_result<OutputIt>
vformat_to_n(
OutputIt out,
size_t n,
string_view fmt,
format_args args);
» more...
template<
typename OutputIt,
typename Char,
typename... Args>
format_to_n_result<OutputIt>
vformat_to_n(
OutputIt out,
size_t n,
basic_string_view<Char> fmt,
basic_format_args<buffered_context<Char>> args);
» more...
Declared in <fmt/base.h>
template<
typename OutputIt,
typename... T>
format_to_n_result<OutputIt>
vformat_to_n(
OutputIt out,
size_t n,
string_view fmt,
format_args args);
Declared in <fmt/xchar.h>
template<
typename OutputIt,
typename Char,
typename... Args>
format_to_n_result<OutputIt>
vformat_to_n(
OutputIt out,
size_t n,
basic_string_view<Char> fmt,
basic_format_args<buffered_context<Char>> args);
Declared in <fmt/printf.h>
template<typename Char>
int
vfprintf(
FILE* f,
basic_string_view<Char> fmt,
vprintf_args<Char>::type args);
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...
Declared in <fmt/ostream.h>
void
vprint(
std::ostream& os,
string_view fmt,
format_args args);
Declared in <fmt/xchar.h>
void
vprint(
std::wostream& os,
wstring_view fmt,
wformat_args args);
Declared in <fmt/color.h>
void
vprint(
FILE* f,
text_style ts,
string_view fmt,
format_args args);
Declared in <fmt/base.h>
void
vprint_buffered(
FILE* f,
string_view fmt,
format_args args);
Declared in <fmt/base.h>
void
vprintln(
FILE* f,
string_view fmt,
format_args args);
» more...
void
vprintln(
FILE* f,
text_style ts,
string_view fmt,
format_args args);
» more...
Declared in <fmt/color.h>
void
vprintln(
FILE* f,
text_style ts,
string_view fmt,
format_args args);
Declared in <fmt/printf.h>
template<typename Char>
std::basic_string<Char>
vsprintf(
basic_string_view<Char> fmt,
vprintf_args<Char>::type args);
Declared in <fmt/format.h>
std::system_error
vsystem_error(
int error_code,
string_view fmt,
format_args args);
Equality operator
Declared in <fmt/base.h>
constexpr
bool
operator==(
basic_string_view lhs,
basic_string_view rhs);
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Inequality operator
true if the objects are not equal, false otherwise
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Less-than operator
true if the left object is less than the right object, false otherwise
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Less-than-or-equal operator
true if the left object is less than or equal to the right object, false otherwise
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Greater-than operator
true if the left object is greater than the right object, false otherwise
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Greater-than-or-equal operator
true if the left object is greater than or equal to the right object, false otherwise
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Declared in <fmt/base.h>
template<
typename T,
typename Char = char>
concept formattable = is_formattable<remove_reference_t<T>, Char>::value;