class basic_memory_buffer

Declaration

template <typename T,
          size_t SIZE = inline_buffer_size,
          typename Allocator = std::allocator<T>>
class basic_memory_buffer { /* full declaration omitted */ };

Description

\rstA 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(); 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

Declared at: third_party/fmt/include/fmt/format.h:919

Templates

T
size_t SIZE
Allocator

Method Overview

Methods

template <typename ContiguousRange>
void append(const ContiguousRange& range)

Declared at: third_party/fmt/include/fmt/format.h:1025

Templates

ContiguousRange

Parameters

const ContiguousRange& range

constexpr basic_memory_buffer<T, SIZE, Allocator>(
    const Allocator& alloc = type - parameter -
                             0 - 2())

Declared at: third_party/fmt/include/fmt/format.h:960

Parameters

const Allocator& alloc = type-parameter-0-2()

constexpr basic_memory_buffer<T, SIZE, Allocator>(
    basic_memory_buffer<T, SIZE, Allocator>&&
        other) noexcept

Description

\rstConstructs a :class:`fmt::basic_memory_buffer` object moving the content of the other object to it.\endrst

Declared at: third_party/fmt/include/fmt/format.h:994

Parameters

basic_memory_buffer<T, SIZE, Allocator>&& other

auto get_allocator() const -> Allocator

Declared at: third_party/fmt/include/fmt/format.h:1011

constexpr void grow(size_t size)

Declared at: third_party/fmt/include/fmt/format.h:933

Parameters

size_t size

void reserve(size_t new_capacity)

Description

Increases the buffer capacity to *new_capacity*.

Declared at: third_party/fmt/include/fmt/format.h:1020

Parameters

size_t new_capacity

constexpr void resize(size_t count)

Description

Resizes the buffer to contain *count* elements. If T is a POD type new elements may not be initialized.

Declared at: third_party/fmt/include/fmt/format.h:1017

Parameters

size_t count

constexpr ~basic_memory_buffer<T,
                               SIZE,
                               Allocator>()

Declared at: third_party/fmt/include/fmt/format.h:966