#include <format.h>
Public Types | |
using | const_reference = const T & |
using | value_type = T |
Public Types inherited from detail::buffer< T > | |
using | const_reference = const T & |
using | value_type = T |
Public Member Functions | |
template<typename ContiguousRange > | |
void | append (const ContiguousRange &range) |
FMT_CONSTEXPR20 | basic_memory_buffer (basic_memory_buffer &&other) noexcept |
FMT_CONSTEXPR20 | basic_memory_buffer (const Allocator &alloc=Allocator()) |
auto | get_allocator () const -> Allocator |
auto | operator= (basic_memory_buffer &&other) noexcept -> basic_memory_buffer & |
void | reserve (size_t new_capacity) |
FMT_CONSTEXPR20 void | resize (size_t count) |
FMT_CONSTEXPR20 | ~basic_memory_buffer () |
Public Member Functions inherited from detail::buffer< T > | |
template<typename U > | |
void | append (const U *begin, const U *end) |
FMT_INLINE auto | begin () const noexcept -> const T * |
FMT_INLINE auto | begin () noexcept -> T * |
buffer (const buffer &)=delete | |
constexpr auto | capacity () const noexcept -> size_t |
void | clear () |
FMT_CONSTEXPR auto | data () const noexcept -> const T * |
FMT_CONSTEXPR auto | data () noexcept -> T * |
FMT_INLINE auto | end () const noexcept -> const T * |
FMT_INLINE auto | end () noexcept -> T * |
void | operator= (const buffer &)=delete |
template<typename Idx > | |
FMT_CONSTEXPR auto | operator[] (Idx index) -> T & |
template<typename Idx > | |
FMT_CONSTEXPR auto | operator[] (Idx index) const -> const T & |
FMT_CONSTEXPR20 void | push_back (const T &value) |
constexpr auto | size () const noexcept -> size_t |
FMT_CONSTEXPR20 void | try_reserve (size_t new_capacity) |
FMT_CONSTEXPR20 void | try_resize (size_t count) |
Protected Member Functions | |
FMT_CONSTEXPR20 void | grow (size_t size) override |
Protected Member Functions inherited from detail::buffer< T > | |
buffer (buffer &&)=default | |
FMT_CONSTEXPR | buffer (size_t sz) noexcept |
FMT_CONSTEXPR20 | buffer (T *p=nullptr, size_t sz=0, size_t cap=0) noexcept |
FMT_CONSTEXPR void | set (T *buf_data, size_t buf_capacity) noexcept |
FMT_CONSTEXPR20 | ~buffer ()=default |
Private Member Functions | |
FMT_CONSTEXPR20 void | deallocate () |
FMT_CONSTEXPR20 void | move (basic_memory_buffer &other) |
Private Attributes | |
FMT_NO_UNIQUE_ADDRESS Allocator | alloc_ |
T | store_ [SIZE] |
\rst A dynamically growing memory buffer for trivially copyable/constructible types with the first SIZE
elements stored in the object itself.
You can use the memory_buffer
type alias for char
instead.
Example**::
auto out = fmt::memory_buffer(); fmt::format_to(std::back_inserter(out), "The answer is {}.", 42);
This will append the following output to the out
object:
.. code-block:: none
The answer is 42.
The output can be converted to an std::string
with to_string(out)
. \endrst
using basic_memory_buffer< T, SIZE, Allocator >::const_reference = const T& |
using basic_memory_buffer< T, SIZE, Allocator >::value_type = T |
|
inlineexplicit |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlineprivate |
|
inline |
|
inlineoverrideprotectedvirtual |
Increases the buffer capacity to hold at least capacity elements.
Implements detail::buffer< T >.
|
inlineprivate |
|
inlinenoexcept |
\rst Moves the content of the other basic_memory_buffer
object to this one. \endrst
|
inline |
|
inline |
|
private |
|
private |