We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84092cb commit 918ac2bCopy full SHA for 918ac2b
src/util/buffer.h
@@ -21,7 +21,7 @@ Revision History:
21
--*/
22
#pragma once
23
24
-#include <type_traits>
+#include <cstddef>
25
#include "util/memory_manager.h"
26
27
template<typename T, bool CallDestructors=true, unsigned INITIAL_SIZE=16>
@@ -30,7 +30,7 @@ class buffer {
30
T * m_buffer = reinterpret_cast<T*>(m_initial_buffer);
31
unsigned m_pos = 0;
32
unsigned m_capacity = INITIAL_SIZE;
33
- typename std::aligned_storage<sizeof(T), alignof(T)>::type m_initial_buffer[INITIAL_SIZE];
+ alignas(T) std::byte m_initial_buffer[INITIAL_SIZE * sizeof(T)];
34
35
void free_memory() {
36
if (m_buffer != reinterpret_cast<T*>(m_initial_buffer)) {
0 commit comments