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

#include <format_string.hpp>

Public Member Functions

template<std::size_t N>
FLY_CONSTEVAL BasicFormatString (const CharType(&format)[N]) noexcept
 
 BasicFormatString (BasicFormatString &&)=default
 
BasicFormatStringoperator= (BasicFormatString &&)=default
 
constexpr FormatParseContextcontext ()
 
std::optional< FormatSpecifiernext_specifier ()
 

Detailed Description

template<fly::StandardCharacter CharType, typename... ParameterTypes>
class fly::detail::BasicFormatString< CharType, ParameterTypes >

A container to hold and parse a format string at compile time.

This class depends on C++20 immediate functions (consteval), which are not yet supported by all compilers. With compilers that do support immediate functions, if a format string is invalid (either due to syntax or the foratting parameter types), a compile error will be raised with a brief message indicating the error. For other compilers, that error message will be stored in the instance and callers should check if an error was encountered.

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

Constructor & Destructor Documentation

◆ BasicFormatString()

template<fly::StandardCharacter CharType, typename... ParameterTypes>
template<std::size_t N>
FLY_CONSTEVAL fly::detail::BasicFormatString< CharType, ParameterTypes >::BasicFormatString ( const CharType(&)  format[N])
noexcept

Constructor. Parse and validate a C-string literal as a format string.

Member Function Documentation

◆ context()

template<fly::StandardCharacter CharType, typename... ParameterTypes>
constexpr BasicFormatParseContext< CharType > & fly::detail::BasicFormatString< CharType, ParameterTypes >::context
constexpr
Returns
A reference to the format parsing context.

◆ next_specifier()

template<fly::StandardCharacter CharType, typename... ParameterTypes>
auto fly::detail::BasicFormatString< CharType, ParameterTypes >::next_specifier
Returns
If available, the next parsed replacement field. Otherwise, an uninitialized value.

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