#include <format.h>
template<typename T, std::size_t SIZE, typename Allocator = std::allocator<T>>
675 : Allocator(alloc), Buffer<T>(
data_, SIZE) {}
T data_[SIZE]
Definition: format.h:663
template<typename T, std::size_t SIZE, typename Allocator = std::allocator<T>>
void deallocate()
Definition: format.h:666
template<typename T, std::size_t SIZE, typename Allocator = std::allocator<T>>
T data_[SIZE]
Definition: format.h:663
T * ptr_
Definition: format.h:586
std::size_t capacity_
Definition: format.h:588
template<typename T, std::size_t SIZE, typename Allocator = std::allocator<T>>
template<typename T , std::size_t SIZE, typename Allocator >
Increases the buffer capacity to hold at least size elements updating ptr_
and capacity_
.
Implements fmt::Buffer< T >.
718 if (
size > new_capacity)
720 T *new_ptr = this->allocate(new_capacity);
722 std::uninitialized_copy(this->
ptr_, this->
ptr_ + this->
size_,
724 std::size_t old_capacity = this->
capacity_;
725 T *old_ptr = this->
ptr_;
727 this->
ptr_ = new_ptr;
731 if (old_ptr !=
data_)
732 Allocator::deallocate(old_ptr, old_capacity);
std::size_t size_
Definition: format.h:587
T data_[SIZE]
Definition: format.h:663
T * make_ptr(T *ptr, std::size_t)
Definition: format.h:571
std::size_t size() const
Definition: format.h:605
T * ptr_
Definition: format.h:586
std::size_t capacity_
Definition: format.h:588
template<typename T, std::size_t SIZE, typename Allocator = std::allocator<T>>
The documentation for this class was generated from the following file: