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

Output sink adapter for arbitrary output iterators or raw pointers. More...

#include <microfmt.hpp>

Public Member Functions

constexpr iterator_sink (OutputIt it) noexcept
 Constructs an iterator sink wrapping the target output iterator.
 
RELOCO_BEGIN_UNSAFE_CODE sink as_sink () &noexcept RELOCO_LIFETIMEBOUND
 Creates a type-erased sink adapter pointing to this instance.
 
RELOCO_END_UNSAFE_CODE constexpr OutputIt current () const noexcept
 Returns the current state of the output iterator.
 

Detailed Description

template<typename OutputIt>
class microfmt::iterator_sink< OutputIt >

Output sink adapter for arbitrary output iterators or raw pointers.

Adapts an iterator (e.g., char*, std::back_insert_iterator) to the type-erased sink interface, forwarding writes using standard algorithm functions.

Template Parameters
OutputItThe type of the output iterator.

Constructor & Destructor Documentation

◆ iterator_sink()

template<typename OutputIt >
constexpr microfmt::iterator_sink< OutputIt >::iterator_sink ( OutputIt  it)
inlineexplicitconstexprnoexcept

Constructs an iterator sink wrapping the target output iterator.

Parameters
itTarget output iterator.

Member Function Documentation

◆ as_sink()

template<typename OutputIt >
RELOCO_BEGIN_UNSAFE_CODE sink microfmt::iterator_sink< OutputIt >::as_sink ( ) &
inlinenoexcept

Creates a type-erased sink adapter pointing to this instance.

Returns
A lightweight sink struct configured with a callback to forward writes.

◆ current()

template<typename OutputIt >
RELOCO_END_UNSAFE_CODE constexpr OutputIt microfmt::iterator_sink< OutputIt >::current ( ) const
inlineconstexprnoexcept

Returns the current state of the output iterator.

Returns
Current output iterator position.

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