Namespaces
Variants
Views
Actions

std::make_format_args, std::make_wformat_args

From cppreference.com
< cpp‎ | utility‎ | format
 
 
Utilities library
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++17)

Elementary string conversions
(C++17)
(C++17)
 
Formatting library
Formatting functions
(C++20)
(C++20)
(C++20)
(C++20)
Formatter
(C++20)
Formatting arguments
make_format_argsmake_wformat_args
(C++20)(C++20)
Format error
 
Defined in header <format>
template<class Context = std::format_context, class... Args>
/*format-arg-store*/<Context, Args...> make_format_args(const Args&... args);
(1) (since C++20)
template<class... Args>
/*format-arg-store*/<std::wformat_context, Args...> make_wformat_args(const Args&... args);
(2) (since C++20)

Returns an object that stores an array of formatting arguments and can be implicitly converted to std::basic_format_args<Context>.

The behavior is undefined if typename Context::template formatter_type<Ti> does not meet the Formatter requirements for any Ti in Args.

Contents

[edit] Parameters

args... - values to be used as formatting arguments

[edit] Returns

An object that holds the formatting arguments.

[edit] Notes

A formatting argument has reference semantics for user-defined types and does not extend the lifetime of args. It is the programmer's responsibility to ensure that args outlive the return value. Usually, the result is only used as argument to formatting function.

[edit] Example

[edit] See also