29 #ifndef _ALIGNED_BUFFER_H
30 #define _ALIGNED_BUFFER_H 1
32 #pragma GCC system_header
34 #if __cplusplus >= 201103L
35 # include <type_traits>
42 template<
typename _Tp>
43 struct __aligned_buffer
44 : std::aligned_storage<sizeof(_Tp), std::alignment_of<_Tp>::value>
47 std::aligned_storage<sizeof(_Tp), std::alignment_of<_Tp>::value>::type
50 __aligned_buffer() =
default;
53 __aligned_buffer(std::nullptr_t) { }
58 return static_cast<void*
>(&_M_storage);
62 _M_addr() const noexcept
64 return static_cast<const void*
>(&_M_storage);
69 {
return static_cast<_Tp*
>(_M_addr()); }
72 _M_ptr() const noexcept
73 {
return static_cast<const _Tp*
>(_M_addr()); }
GNU extensions for public use.