std::basic_format_args
<format>
class basic_format_args;
Provides access to formatting arguments.
Contents
[edit] Member functions
basic_format_args
object (public member function)
(public member function)
std::basic_format_args::basic_format_args
basic_format_args( const /*format-arg-store*/<Context, Args...>& store ) noexcept;
Constructs a basic_format_args
object from the result of a call to std::make_format_args or std::make_wformat_args .
std::basic_format_args::get
Returns a std::basic_format_arg holding the i-th argument in args
, where args
is the parameter pack passed to std::make_format_args or std::make_wformat_args .
If there's no such formatting argument (i.e. *this was default-constructed or i is not less than the number of formatting arguments), returns a default-constructed std::basic_format_arg (holding a std::monostate object).
[edit] Deduction guides
basic_format_args( /*format-arg-store*/<Context, Args...> ) -> basic_format_args<Context>;
[edit] Notes
std::basic_format_args
has reference semantics. It is the programmer's responsibility to ensure that *this does not outlive store (which, in turn, should not outlive the arguments to std::make_format_args or std::make_wformat_args ).
[edit] Example
Reason: no example
[edit] Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR | Applied to | Behavior as published | Correct behavior |
---|---|---|---|
P2216R3 | C++20 | format_args_t was provided due to overparameterization of vformat_to
|
removed |
LWG 3810 | C++20 | basic_format_args has no deduction guide
|
added |
LWG 4106 | C++20 | basic_format_args was default-constructible
|
default constructor removed |
[edit] See also
(class template) [edit]