Skip to content

Commit 1dc92e9

Browse files
committed
Fix c++23 deprecated std::aligned_storage warning
1 parent 716e1dc commit 1dc92e9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

yasio/type_traits.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,16 @@ SOFTWARE.
2727
*/
2828

2929
#pragma once
30+
31+
#include <cstddef>
3032
#include <type_traits>
33+
#include "yasio/sz.hpp"
3134

3235
namespace yasio
3336
{
3437
template <typename _Ty>
3538
struct aligned_storage_size {
36-
static const size_t value = sizeof(typename std::aligned_storage<sizeof(_Ty)>::type);
39+
static const size_t value = YASIO_SZ_ALIGN(sizeof(_Ty), sizeof(std::max_align_t));
3740
};
3841
template <typename _Ty>
3942
struct is_aligned_storage {

0 commit comments

Comments
 (0)