Skip to content

Commit 918ac2b

Browse files
committed
fix #7196: make the code C++23 compatible
Nikolaj is now more bleeding edge than I am... I must be getting old? (˘・_・˘)
1 parent 84092cb commit 918ac2b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/buffer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Revision History:
2121
--*/
2222
#pragma once
2323

24-
#include <type_traits>
24+
#include <cstddef>
2525
#include "util/memory_manager.h"
2626

2727
template<typename T, bool CallDestructors=true, unsigned INITIAL_SIZE=16>
@@ -30,7 +30,7 @@ class buffer {
3030
T * m_buffer = reinterpret_cast<T*>(m_initial_buffer);
3131
unsigned m_pos = 0;
3232
unsigned m_capacity = INITIAL_SIZE;
33-
typename std::aligned_storage<sizeof(T), alignof(T)>::type m_initial_buffer[INITIAL_SIZE];
33+
alignas(T) std::byte m_initial_buffer[INITIAL_SIZE * sizeof(T)];
3434

3535
void free_memory() {
3636
if (m_buffer != reinterpret_cast<T*>(m_initial_buffer)) {

0 commit comments

Comments
 (0)