FlatImage
A configurable Linux containerization system
Loading...
Searching...
No Matches
anonymous_namespace{common.hpp}::format_args< Args > Struct Template Reference

Helper struct for converting arguments to format-compatible strings. More...

#include <common.hpp>

Public Member Functions

 format_args (Args &&... args)
 Constructs format_args by converting all arguments to strings.
 
auto operator* ()
 Dereference operator to get format arguments.
 

Public Attributes

std::tuple< decltype(ns_string::to_string(std::declval< Args >()))... > m_tuple_args
 Tuple storing string representations of all arguments.
 

Detailed Description

template<typename... Args>
struct anonymous_namespace{common.hpp}::format_args< Args >

Helper struct for converting arguments to format-compatible strings.

This template struct converts all provided arguments to their string representations using ns_string::to_string() and stores them in a tuple. The converted strings can then be used with std::format functions.

Template Parameters
ArgsVariadic template parameters for the types to be converted

Definition at line 34 of file common.hpp.

Constructor & Destructor Documentation

◆ format_args()

template<typename... Args>
anonymous_namespace{common.hpp}::format_args< Args >::format_args ( Args &&... args)
inline

Constructs format_args by converting all arguments to strings.

Parameters
argsArguments to be converted to string representations
Note
Uses perfect forwarding to preserve value categories

Definition at line 50 of file common.hpp.

Member Function Documentation

◆ operator*()

template<typename... Args>
auto anonymous_namespace{common.hpp}::format_args< Args >::operator* ( )
inline

Dereference operator to get format arguments.

Applies std::make_format_args to the stored string tuple elements

Returns
Format arguments compatible with std::format functions

Definition at line 61 of file common.hpp.

Member Data Documentation

◆ m_tuple_args

template<typename... Args>
std::tuple<decltype(ns_string::to_string(std::declval<Args>()))...> anonymous_namespace{common.hpp}::format_args< Args >::m_tuple_args

Tuple storing string representations of all arguments.

Each element type is determined by the return type of ns_string::to_string() when called with the corresponding argument type

Definition at line 42 of file common.hpp.


The documentation for this struct was generated from the following file: