SimulationCraft
SimulationCraft is a tool to explore combat mechanics in the popular MMO RPG World of Warcraft (tm).
basic_format_args< Context > Class Template Reference

A view of a collection of formatting arguments. More...

#include <core.h>

Public Types

using size_type = int
 
using format_arg = basic_format_arg< Context >
 

Public Member Functions

template<typename... Args>
constexpr FMT_INLINE basic_format_args (const format_arg_store< Context, Args... > &store)
 Constructs a basic_format_args object from ~fmtformat_arg_store. More...
 
constexpr FMT_INLINE basic_format_args (const dynamic_format_arg_store< Context > &store)
 Constructs a basic_format_args object from ~fmtdynamic_format_arg_store. More...
 
constexpr basic_format_args (const format_arg *args, int count)
 Constructs a basic_format_args object from a dynamic set of arguments. More...
 
FMT_CONSTEXPR auto get (int id) const -> format_arg
 Returns the argument with the specified id. More...
 
template<typename Char >
auto get (basic_string_view< Char > name) const -> format_arg
 
template<typename Char >
auto get_id (basic_string_view< Char > name) const -> int
 
auto max_size () const -> int
 

Detailed Description

template<typename Context>
class basic_format_args< Context >

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::

void vlog(string_view format_str, format_args args); // OK format_args args = make_format_args(42); // Error: dangling reference

Constructor & Destructor Documentation

◆ basic_format_args() [1/3]

template<typename Context>
template<typename... Args>
constexpr FMT_INLINE basic_format_args< Context >::basic_format_args ( const format_arg_store< Context, Args... > &  store)
inline

Constructs a basic_format_args object from ~fmtformat_arg_store.

◆ basic_format_args() [2/3]

template<typename Context>
constexpr FMT_INLINE basic_format_args< Context >::basic_format_args ( const dynamic_format_arg_store< Context > &  store)
inline

Constructs a basic_format_args object from ~fmtdynamic_format_arg_store.

◆ basic_format_args() [3/3]

template<typename Context>
constexpr basic_format_args< Context >::basic_format_args ( const format_arg args,
int  count 
)
inline

Constructs a basic_format_args object from a dynamic set of arguments.

Member Function Documentation

◆ get()

template<typename Context>
FMT_CONSTEXPR auto basic_format_args< Context >::get ( int  id) const -> format_arg
inline

Returns the argument with the specified id.