diff --git a/include/boost/fiber/buffered_channel.hpp b/include/boost/fiber/buffered_channel.hpp index 492486d3..fd01325e 100644 --- a/include/boost/fiber/buffered_channel.hpp +++ b/include/boost/fiber/buffered_channel.hpp @@ -356,10 +356,10 @@ class buffered_channel { class iterator { private: - typedef typename std::aligned_storage< sizeof( value_type), alignof( value_type) >::type storage_type; + typedef unsigned char storage_type[sizeof(value_type)]; - buffered_channel * chan_{ nullptr }; - storage_type storage_; + buffered_channel * chan_{ nullptr }; + alignas(value_type) storage_type storage_; void increment_( bool initial = false) { BOOST_ASSERT( nullptr != chan_); diff --git a/include/boost/fiber/unbuffered_channel.hpp b/include/boost/fiber/unbuffered_channel.hpp index 4b8c807b..704b3456 100644 --- a/include/boost/fiber/unbuffered_channel.hpp +++ b/include/boost/fiber/unbuffered_channel.hpp @@ -392,10 +392,10 @@ class unbuffered_channel { class iterator { private: - typedef typename std::aligned_storage< sizeof( value_type), alignof( value_type) >::type storage_type; + typedef unsigned char storage_type[sizeof(value_type)]; - unbuffered_channel * chan_{ nullptr }; - storage_type storage_; + unbuffered_channel * chan_{ nullptr }; + alignas(value_type) storage_type storage_; void increment_( bool initial = false) { BOOST_ASSERT( nullptr != chan_); diff --git a/performance/thread/buffered_channel.hpp b/performance/thread/buffered_channel.hpp index 7f021dfc..08a98543 100644 --- a/performance/thread/buffered_channel.hpp +++ b/performance/thread/buffered_channel.hpp @@ -38,11 +38,11 @@ class buffered_channel { typedef T value_type; private: - typedef typename std::aligned_storage< sizeof( T), alignof( T) >::type storage_type; + typedef unsigned char storage_type[sizeof(T)]; struct alignas(cache_alignment) slot { std::atomic< std::size_t > cycle{ 0 }; - storage_type storage{}; + alignas(T) storage_type storage{}; slot() = default; };