Replace std::aligned_storage<T, ...> with alignas(T) unsigned char[]

This commit is contained in:
Danil Sidoruk
2026-05-30 21:00:50 +03:00
parent e7c2bda93a
commit 1e60d18a84
3 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -356,10 +356,10 @@ public:
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_;
alignas(value_type) storage_type storage_;
void increment_( bool initial = false) {
BOOST_ASSERT( nullptr != chan_);
+2 -2
View File
@@ -392,10 +392,10 @@ public:
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_;
alignas(value_type) storage_type storage_;
void increment_( bool initial = false) {
BOOST_ASSERT( nullptr != chan_);
+2 -2
View File
@@ -38,11 +38,11 @@ public:
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;
};