mirror of
https://github.com/boostorg/fiber.git
synced 2026-07-21 13:13:32 +00:00
Replace std::aligned_storage<T, ...> with alignas(T) unsigned char[]
This commit is contained in:
@@ -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_);
|
||||
|
||||
@@ -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_);
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user