microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
variant.hpp File Reference

`std::variant` and non-owning variant view formatting. More...

#include "../microfmt.hpp"
#include <string_view>
#include <type_traits>
#include <variant>
Include dependency graph for variant.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  microfmt::variant_view< Ts >
 Non-owning view over a std::variant with optional decorations. More...
 
struct  microfmt::formatter< variant_view< Ts... > >
 Formatter for variant_view. More...
 
struct  microfmt::formatter< std::variant< Ts... > >
 Formatter for std::variant, delegating to the variant_view formatter. More...
 
struct  microfmt::formatter< std::monostate >
 Formatter for std::monostate, rendering it as null. More...
 

Namespaces

namespace  microfmt
 

Functions

template<typename... Ts>
constexpr auto microfmt::as_variant (const std::variant< Ts... > &var RELOCO_LIFETIMEBOUND) noexcept
 Wraps a variant for plain formatting.
 
template<typename... Ts>
constexpr auto microfmt::as_variant (std::variant< Ts... > &&) noexcept=delete
 
template<typename... Ts>
constexpr auto microfmt::as_variant (const std::variant< Ts... > &&) noexcept=delete
 
template<typename... Ts>
constexpr auto microfmt::as_variant (const std::variant< Ts... > &var RELOCO_LIFETIMEBOUND, microfmt::string_view prefix, microfmt::string_view suffix) noexcept
 Wraps a variant with custom prefix/suffix decorations.
 
template<typename... Ts>
constexpr auto microfmt::as_variant (std::variant< Ts... > &&, microfmt::string_view, microfmt::string_view) noexcept=delete
 
template<typename... Ts>
constexpr auto microfmt::as_variant (const std::variant< Ts... > &&, microfmt::string_view, microfmt::string_view) noexcept=delete
 
template<typename... Ts>
constexpr auto microfmt::as_debug_variant (const std::variant< Ts... > &var RELOCO_LIFETIMEBOUND, bool show_index=false) noexcept
 Wraps a variant for debug output (variant(index, ...)).
 
template<typename... Ts>
constexpr auto microfmt::as_debug_variant (std::variant< Ts... > &&, bool=false) noexcept=delete
 
template<typename... Ts>
constexpr auto microfmt::as_debug_variant (const std::variant< Ts... > &&, bool=false) noexcept=delete
 

Detailed Description

`std::variant` and non-owning variant view formatting.