std::basic_format_args(3)
๐ธ NAME ๐ธ
Bestie, this is std::basic_format_args โ the manual page is std::basic_format_args(3), from the C++ Standard Library (the header says C++ Standard Libary, and honestly? iconic typo). The NAME line is literally std::basic_format_args - std::basic_format_args, so it said what it said. ๐
โจ Synopsis โจ
Defined in header <format>.
template< class Context > (1)
(since C++20)
class basic_format_args;
using format_args = basic_format_args<std::format_context>; (2)
(since C++20)
using wformat_args = basic_format_args<std::wformat_context>; (3)
(since C++20)
Provides access to formatting arguments. periodt. ๐
๐ Member functions ๐
constructorโ constructs abasic_format_argsobject (public member function)getโ returns formatting argument at the given index (public member function)
๐ std::basic_format_args::basic_format_args ๐
basic_format_args() noexcept;
(1)
template< class... Args >
basic_format_args( const /*format-arg-store*/<Context, Args...>& store ) noexcept;
(2)
- Overload (1) โ constructs a
basic_format_argsobject that does not hold any formatting argument. - Overload (2) โ constructs a
basic_format_argsobject from the result of a call tostd::make_format_argsorstd::make_wformat_args.
๐จstd::basic_format_argshas reference semantics. It is the programmer's responsibility to ensure that*thisdoes not outlivestore(which, in turn, should not outlive the arguments tostd::make_format_argsorstd::make_wformat_args). No cap.
๐ฏ std::basic_format_args::get ๐ฏ
std::basic_format_arg<Context> get( std::size_t i ) const noexcept;
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). Vibe check: handled. ๐
๐ฎ Deduction guides ๐ฎ
template< class Context, class... Args >
basic_format_args( /*format-arg-store*/<Context, Args...> ) -> basic_format_args<Context>;
(since C++20)
๐ Example ๐
This section is incomplete, bestie. The reason is literally: Reason: no example. That's it. That's the whole section. ๐ญ
๐ Defect reports ๐
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
- P2216R3
- Applied to: C++20
- Behavior as published:
format_args_twas provided due to overparameterization ofvformat_to - Correct behavior: removed
- LWG3810
- Applied to: C++20
- Behavior as published:
basic_format_argshas no deduction guide - Correct behavior: added
๐ฆ See also ๐ฆ
basic_format_arg(C++20) โ class template that provides access to a formatting argument for user-defined formatters (class template)
๐ Category ๐
Todo no example
๐ that's the whole page, bestie โ source: http://cppreference.com, dated 2024.06.10, page std::basic_format_args(3). go off, C++ formatting icon โจ๐
๐ฆ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms