|
microfmt
Zero-allocation C++ formatting for constrained environments
|
Format a single value repeated a fixed number of times. More...
#include "../microfmt.hpp"#include <cstddef>#include <string_view>#include <type_traits>#include <utility>
Go to the source code of this file.
Classes | |
| struct | microfmt::repeated_view< T > |
| struct | microfmt::formatter< repeated_view< T > > |
Namespaces | |
| namespace | microfmt |
Functions | |
| template<typename T > | |
| constexpr auto | microfmt::repeat (T value, size_t count) noexcept |
| template<typename T > | |
| constexpr auto | microfmt::repeat (T value, size_t count, microfmt::string_view separator) noexcept |
Format a single value repeated a fixed number of times.
Use microfmt::repeat to wrap any formattable value together with a repeat count and an optional separator. The view stores the value by decayed copy without allocation and formats it count times, writing the separator between consecutive repetitions. The complete replacement-field specifier is forwarded to the wrapped value's formatter on every repetition.