fmt::basic_memory_buffer

A dynamically growing memory buffer for trivially copyable/constructible types with the first SIZE elements stored in the object itself. Most commonly used via the memory_buffer alias for char.

Synopsis

Declared in <fmt/format.h>
template<
    typename T,
    size_t SIZE = inline_buffer_size,
    typename Allocator = /* implementation-defined */>
class basic_memory_buffer
    : public /* implementation-defined */


Base Classes

Name Description
/* implementation-defined */A contiguous memory buffer with an optional growing ability. It is an internal class and shouldn't be used directly, only via memory_buffer.

Types

Name
const_reference
value_type

Member Functions

Name Description
basic_memory_buffer [constructor]Constructs a basic_memory_buffer object moving the content of the other object to it.
~basic_memory_buffer [destructor]Destructor
operator= Moves the content of the other basic_memory_buffer object to this one.
append
get_allocator
reserve Increases the buffer capacity to new_capacity.
resize Resizes the buffer to contain count elements. If T is a POD type new elements may not be initialized.

Description

*Example:

auto out = fmt::memory_buffer(); fmt::format_to(std::back_inserter(out), "The answer is {}.", 42);

This will append "The answer is 42." to out. The buffer content can be converted to std::string with to_string(out).

Created with MrDocs