Template memory_buffer aliases
This allows consumers to write something like `fmt::memory_buffer<50>` instead of `fmt::basic_memory_buffer<char, 50>` to save stack space when they know that the result of the formatting cannot be bigger than 50 characters.
This commit is contained in:
parent
35959a31d7
commit
f913388a1c
@ -700,8 +700,11 @@ void basic_memory_buffer<T, SIZE, Allocator>::grow(std::size_t size) {
|
|||||||
if (old_data != store_) Allocator::deallocate(old_data, old_capacity);
|
if (old_data != store_) Allocator::deallocate(old_data, old_capacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
using memory_buffer = basic_memory_buffer<char>;
|
template<std::size_t SIZE = inline_buffer_size, typename Allocator = std::allocator<T>>
|
||||||
using wmemory_buffer = basic_memory_buffer<wchar_t>;
|
using memory_buffer = basic_memory_buffer<char, SIZE, Allocator>;
|
||||||
|
|
||||||
|
template<std::size_t SIZE = inline_buffer_size, typename Allocator = std::allocator<T>>
|
||||||
|
using wmemory_buffer = basic_memory_buffer<wchar_t, SIZE, Allocator>;
|
||||||
|
|
||||||
/** A formatting error such as invalid format string. */
|
/** A formatting error such as invalid format string. */
|
||||||
FMT_CLASS_API
|
FMT_CLASS_API
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user