|
microfmt
Zero-allocation C++ formatting for constrained environments
|
Non-owning view over a std::variant with optional decorations.
More...
#include <variant.hpp>
Public Types | |
| using | variant_type = std::variant< Ts... > |
The wrapped std::variant type. | |
Public Member Functions | |
| constexpr | variant_view (const variant_type &var RELOCO_LIFETIMEBOUND, microfmt::string_view prefix="", microfmt::string_view suffix="", bool show_index=false) noexcept |
| Constructs the view. | |
| constexpr | variant_view (variant_type &&, microfmt::string_view="", microfmt::string_view="", bool=false)=delete |
| constexpr | variant_view (const variant_type &&, microfmt::string_view="", microfmt::string_view="", bool=false)=delete |
| constexpr const variant_type & | get () const noexcept |
| Returns the referenced variant. | |
| constexpr microfmt::string_view | prefix () const noexcept |
| Returns the prefix decoration. | |
| constexpr microfmt::string_view | suffix () const noexcept |
| Returns the suffix decoration. | |
| constexpr bool | show_index () const noexcept |
| Reports whether the alternative index is displayed. | |
Non-owning view over a std::variant with optional decorations.
| Ts | The alternative types of the wrapped variant. |
| using microfmt::variant_view< Ts >::variant_type = std::variant<Ts...> |
The wrapped std::variant type.
|
inlineexplicitconstexprnoexcept |
Constructs the view.
| var | Referenced variant. |
| prefix | Text emitted before the active alternative. |
| suffix | Text emitted after the active alternative. |
| show_index | When true, include the alternative index. |
|
explicitconstexprdelete |
|
explicitconstexprdelete |
|
inlineconstexprnoexcept |
Returns the referenced variant.
std::variant.
|
inlineconstexprnoexcept |
Returns the prefix decoration.
|
inlineconstexprnoexcept |
Reports whether the alternative index is displayed.
true when the index is included in output.
|
inlineconstexprnoexcept |
Returns the suffix decoration.