microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
microfmt::sink_provider< Tag > Class Template Reference

Owning wrapper: holds context_type by value, sharing lifetime with the handle obtained from ref. More...

#include <sink_provider.hpp>

Public Types

using traits_type = sink_provider_traits< Tag >
 
using context_type = typename traits_type::context_type
 

Public Member Functions

constexpr sink_provider (context_type context) noexcept
 Constructs the owning wrapper from an already-built context.
 
constexpr sink_provider_ref ref () &noexcept RELOCO_LIFETIMEBOUND
 Borrows a sink_provider_ref bound to this wrapper's context.
 
constexpr sink as_sink () &noexcept RELOCO_LIFETIMEBOUND
 Convenience shorthand for ref().as_sink().
 

Detailed Description

template<typename Tag>
class microfmt::sink_provider< Tag >

Owning wrapper: holds context_type by value, sharing lifetime with the handle obtained from ref.

Template Parameters
TagSink tag identifying a stateful sink_provider_traits specialization. Stateless tags have no per-instance state to own; use sink_provider_ref{Tag{}} directly instead.

Member Typedef Documentation

◆ context_type

template<typename Tag >
using microfmt::sink_provider< Tag >::context_type = typename traits_type::context_type

◆ traits_type

template<typename Tag >
using microfmt::sink_provider< Tag >::traits_type = sink_provider_traits<Tag>

Constructor & Destructor Documentation

◆ sink_provider()

template<typename Tag >
constexpr microfmt::sink_provider< Tag >::sink_provider ( context_type  context)
inlineexplicitconstexprnoexcept

Constructs the owning wrapper from an already-built context.

Member Function Documentation

◆ as_sink()

template<typename Tag >
constexpr sink microfmt::sink_provider< Tag >::as_sink ( ) &
inlineconstexprnoexcept

Convenience shorthand for ref().as_sink().

◆ ref()

template<typename Tag >
constexpr sink_provider_ref microfmt::sink_provider< Tag >::ref ( ) &
inlineconstexprnoexcept

Borrows a sink_provider_ref bound to this wrapper's context.

Ref-qualified &: calling this on a temporary wrapper is a compile error, since the returned handle would otherwise outlive the context it points into.


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