libdl  0.0.1
Simple yet powerful deep learning
Loading...
Searching...
No Matches
fmt::formatter< std::optional< T > > Struct Template Reference

Public Member Functions

constexpr auto parse (format_parse_context &ctx) -> decltype(ctx.begin())
 
template<typename FormatContext >
auto format (const std::optional< T > &input, FormatContext &ctx) -> decltype(ctx.out())
 

Detailed Description

template<typename T>
struct fmt::formatter< std::optional< T > >

Definition at line 37 of file logging.hpp.

Member Function Documentation

◆ format()

template<typename T >
template<typename FormatContext >
auto fmt::formatter< std::optional< T > >::format ( const std::optional< T > &  input,
FormatContext &  ctx 
) -> decltype(ctx.out())
inline

Definition at line 41 of file logging.hpp.

41 {
42 if (input.has_value())
43 return fmt::format_to(ctx.out(), "{}", input.value());
44 return fmt::format_to(ctx.out(), "<EMPTY>");
45 }

◆ parse()

template<typename T >
constexpr auto fmt::formatter< std::optional< T > >::parse ( format_parse_context &  ctx) -> decltype(ctx.begin())
inlineconstexpr

Definition at line 38 of file logging.hpp.

38{ return ctx.end(); }

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