Output sink that adapts any callable object (lambda, functor) to a sink.
More...
#include <microfmt.hpp>
|
| constexpr | callback_sink (Callable &fn RELOCO_LIFETIMEBOUND RELOCO_LIFETIME_CAPTURE_BY_THIS) noexcept |
| | Constructs a callback sink wrapping a reference to a callable.
|
| |
| sink | as_sink () noexcept RELOCO_LIFETIMEBOUND |
| | Creates a type-erased sink adapter pointing to the wrapped callable.
|
| |
template<typename Callable>
class microfmt::callback_sink< Callable >
Output sink that adapts any callable object (lambda, functor) to a sink.
- Template Parameters
-
| Callable | A callable accepting (microfmt::string_view) or (const char*, std::size_t). |
◆ callback_sink()
template<typename Callable >
| constexpr microfmt::callback_sink< Callable >::callback_sink |
( |
Callable &fn RELOCO_LIFETIMEBOUND |
RELOCO_LIFETIME_CAPTURE_BY_THIS | ) |
|
|
inlineexplicitconstexprnoexcept |
Constructs a callback sink wrapping a reference to a callable.
- Parameters
-
| fn | Reference to the target callable. |
◆ as_sink()
template<typename Callable >
Creates a type-erased sink adapter pointing to the wrapped callable.
- Returns
- A lightweight sink struct forwarding writes to the callable.
The documentation for this class was generated from the following file: