libfly  6.2.2
C++20 utility library for Linux, macOS, and Windows
fly::detail::BasicFormatParameter< FormatContext > Class Template Reference

#include <format_parameters.hpp>

Public Member Functions

constexpr BasicFormatParameter () noexcept
 
template<fly::FormattableUserDefined T>
constexpr BasicFormatParameter (const T &value) noexcept
 
template<fly::FormattableString T>
constexpr BasicFormatParameter (const T &value) noexcept
 
template<fly::FormattablePointer T>
constexpr BasicFormatParameter (T value) noexcept
 
template<fly::FormattableIntegral T>
constexpr BasicFormatParameter (T value) noexcept
 
template<fly::FormattableFloatingPoint T>
constexpr BasicFormatParameter (T value) noexcept
 
template<fly::FormattableBoolean T>
constexpr BasicFormatParameter (T value) noexcept
 
constexpr void format (BasicFormatParseContext< typename FormatContext::char_type > &parse_context, FormatContext &context, BasicFormatSpecifier< char_type > &&specifier) const
 
template<typename Visitor >
constexpr auto visit (Visitor &&visitor) const
 
 operator bool () const noexcept
 

Detailed Description

template<typename FormatContext>
class fly::detail::BasicFormatParameter< FormatContext >

A container to hold a single type-erased format parameter.

Author
Timothy Flynn (trfly.nosp@m.nn89.nosp@m.@pm.m.nosp@m.e)
Version
April 4, 2021

Constructor & Destructor Documentation

◆ BasicFormatParameter() [1/7]

template<typename FormatContext >
constexpr fly::detail::BasicFormatParameter< FormatContext >::BasicFormatParameter
constexprnoexcept

Constructor. Initialize the format parameter to an invalid state.

◆ BasicFormatParameter() [2/7]

template<typename FormatContext >
template<fly::FormattableString T>
constexpr fly::detail::BasicFormatParameter< FormatContext >::BasicFormatParameter ( const T &  value)
explicitconstexprnoexcept

Constructor. Initialize the format parameter to store a type-erased user-defined value.

Template Parameters
TThe user-defined type.
Parameters
valueThe user-defined value.

◆ BasicFormatParameter() [3/7]

template<typename FormatContext >
template<fly::FormattableString T>
constexpr fly::detail::BasicFormatParameter< FormatContext >::BasicFormatParameter ( const T &  value)
explicitconstexprnoexcept

Constructor. Initialize the format parameter to store a type-erased string from any string-like value.

Template Parameters
TThe string-like type.
Parameters
valueThe string-like value.

◆ BasicFormatParameter() [4/7]

template<typename FormatContext >
template<fly::FormattableBoolean T>
constexpr fly::detail::BasicFormatParameter< FormatContext >::BasicFormatParameter ( value)
explicitconstexprnoexcept

Constructor. Initialize the format parameter to store a pointer value.

Template Parameters
TThe pointer type.
Parameters
valueThe pointer value.

◆ BasicFormatParameter() [5/7]

template<typename FormatContext >
template<fly::FormattableIntegral T>
constexpr fly::detail::BasicFormatParameter< FormatContext >::BasicFormatParameter ( value)
explicitconstexprnoexcept

Constructor. Initialize the format parameter to store an integral value.

Template Parameters
TThe integral type.
Parameters
valueThe integral value.

◆ BasicFormatParameter() [6/7]

template<typename FormatContext >
template<fly::FormattableFloatingPoint T>
constexpr fly::detail::BasicFormatParameter< FormatContext >::BasicFormatParameter ( value)
explicitconstexprnoexcept

Constructor. Initialize the format parameter to store a floating-point value.

Template Parameters
TThe floating-point type.
Parameters
valueThe floating-point value.

◆ BasicFormatParameter() [7/7]

template<typename FormatContext >
template<fly::FormattableBoolean T>
constexpr fly::detail::BasicFormatParameter< FormatContext >::BasicFormatParameter ( value)
explicitconstexprnoexcept

Constructor. Initialize the format parameter to store a boolean value.

Template Parameters
TThe boolean type.
Parameters
valueThe boolean value.

Member Function Documentation

◆ format()

template<typename FormatContext >
constexpr void fly::detail::BasicFormatParameter< FormatContext >::format ( BasicFormatParseContext< typename FormatContext::char_type > &  parse_context,
FormatContext &  context,
BasicFormatSpecifier< char_type > &&  specifier 
) const
constexpr

Apply the type-erased formatting function to the stored format parameter.

Parameters
parse_contextThe context holding the format parsing state.
contextThe context holding the formatting state.
specifierThe replacement field to be replaced.

◆ operator bool()

template<typename FormatContext >
fly::detail::BasicFormatParameter< FormatContext >::operator bool
inlineexplicitnoexcept
Returns
True if this format parameter is holding a valid type.

◆ visit()

template<typename FormatContext >
template<typename Visitor >
constexpr auto fly::detail::BasicFormatParameter< FormatContext >::visit ( Visitor &&  visitor) const
constexpr

Apply the provided visitor to the stored format parameter.

Template Parameters
VisitorType of the visitor to invoke.
Parameters
visitorThe visitor to invoke.

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