|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
A generic formatter for enum types, using a user-provided converter functor. More...
#include <formatter.h>

Public Member Functions | |
| template<typename ParseContext > | |
| constexpr auto | parse (ParseContext &context) |
| A no-op parse function required by the formatting library. | |
| template<typename FormatContext > | |
| auto | format (const T &value, FormatContext &context) const |
| Formats the enum value into a provided format context. | |
Static Private Member Functions | |
| template<typename CharT , typename OutputIt > | |
| static auto | do_format (OutputIt &out, const T &value) |
Internal helper that dispatches to std::format based on character type. | |
A generic formatter for enum types, using a user-provided converter functor.
The enum_formatter template allows formatting an enum value by converting it to a string (via a custom Converter functor) and then passing that string to C++20's std::format.
| T | The enum type to be formatted. |
| Converter | A callable object (e.g., a functor or lambda) that accepts an enum value of type T and returns its string representation. |
Definition at line 46 of file formatter.h.
|
inlinestaticprivate |
Internal helper that dispatches to std::format based on character type.
| CharT | The character type (char or wchar_t). |
| OutputIt | The output iterator type. |
| out | An output iterator to which formatted text is appended. |
| value | The enum value to be converted to string and then formatted. |
Definition at line 57 of file formatter.h.
|
inline |
Formats the enum value into a provided format context.
| FormatContext | The type of the format context (provided by std::format). |
| value | The enum value to format. |
| context | The format context, which holds the output iterator and additional state. |
Internally calls the helper do_format() to convert the enum to a string using Converter and then writes it.
Definition at line 92 of file formatter.h.
References kcenon::thread::utils::enum_formatter< T, Converter >::do_format().

|
inlineconstexpr |
A no-op parse function required by the formatting library.
| ParseContext | The parse context type. |
| context | The format parse context. |
context.The formatter does not accept any custom formatting specifiers, so it simply returns context.begin().
Definition at line 80 of file formatter.h.