|
microfmt
Zero-allocation C++ formatting for constrained environments
|
Output sink that counts total formatted bytes without storing characters. More...
#include <microfmt.hpp>
Public Member Functions | |
| constexpr | counting_sink () noexcept=default |
| Constructs a counting sink with a zero byte count. | |
| 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 std::size_t | count () const noexcept |
| Returns the total number of bytes written to the sink. | |
| RELOCO_REINITIALIZES constexpr void | reset () noexcept |
| Resets the internal counter to zero. | |
Output sink that counts total formatted bytes without storing characters.
Useful for computing required buffer sizes before performing an allocation or determining truncation lengths without runtime side-effects.
|
constexprdefaultnoexcept |
Constructs a counting sink with a zero byte count.
|
inlinenoexcept |
|
inlineconstexprnoexcept |
Returns the total number of bytes written to the sink.
|
inlineconstexprnoexcept |
Resets the internal counter to zero.