SimulationCraft
SimulationCraft is a tool to explore combat mechanics in the popular MMO RPG World of Warcraft (tm).
|
A dynamically growing memory buffer for trivially copyable/constructible types with the first SIZE
elements stored in the object itself.
More...
#include <format.h>
Public Types | |
using | value_type = T |
using | const_reference = const T & |
Public Member Functions | |
FMT_CONSTEXPR20 | basic_memory_buffer (const Allocator &alloc=Allocator()) |
FMT_CONSTEXPR20 | basic_memory_buffer (basic_memory_buffer &&other) FMT_NOEXCEPT |
Constructs a :class:fmt::basic_memory_buffer object moving the content of the other object to it. More... | |
auto | operator= (basic_memory_buffer &&other) FMT_NOEXCEPT -> basic_memory_buffer & |
Moves the content of the other basic_memory_buffer object to this one. More... | |
auto | get_allocator () const -> Allocator |
FMT_CONSTEXPR20 void | resize (size_t count) |
Resizes the buffer to contain count elements. More... | |
void | reserve (size_t new_capacity) |
Increases the buffer capacity to new_capacity. More... | |
template<typename ContiguousRange > | |
void | append (const ContiguousRange &range) |
Protected Member Functions | |
FMT_CONSTEXPR20 void | grow (size_t size) override |
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(); 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)
.
|
inline |
Constructs a :class:fmt::basic_memory_buffer
object moving the content of the other object to it.
|
inline |
Moves the content of the other basic_memory_buffer
object to this one.
|
inline |
Increases the buffer capacity to new_capacity.
|
inline |
Resizes the buffer to contain count elements.
If T is a POD type new elements may not be initialized.