fmt::dynamic_format_arg_store::push_back

Adds an argument into the dynamic store for later passing to a formatting function.

Synopsis

Declared in <fmt/args.h>

template<typename T>
void
push_back(T const& arg);

Description

Note that custom types and string types (but not string views) are copied into the store dynamically allocating memory if necessary.

Example:

fmt::dynamic_format_arg_store<fmt::format_context> store; store.push_back(42); store.push_back("abc"); store.push_back(1.5f); std::string result = fmt::vformat("{} and {} and {}", store);

Parameters

NameDescription
argThe argument to add.