File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,10 @@ namespace cereal
134134 // typedefs for parent type and storage type
135135 using BaseType = typename ::cereal::traits::get_shared_from_this_base<T>::type;
136136 using ParentType = std::enable_shared_from_this<BaseType>;
137- using StorageType = typename std::aligned_storage<sizeof (ParentType), CEREAL_ALIGNOF(ParentType)>::type;
137+ class alignas (ParentType) StorageType {
138+ private:
139+ std::byte data[sizeof (ParentType)];
140+ };
138141
139142 public:
140143 // ! Saves the state of some type inheriting from enable_shared_from_this
@@ -380,7 +383,10 @@ namespace cereal
380383 using NonConstT = typename std::remove_const<T>::type;
381384 // Storage type for the pointer - since we can't default construct this type,
382385 // we'll allocate it using std::aligned_storage
383- using AlignedStorage = typename std::aligned_storage<sizeof (NonConstT), CEREAL_ALIGNOF (NonConstT)>::type;
386+ class alignas (NonConstT) AlignedStorage {
387+ private:
388+ std::byte data[sizeof (NonConstT)];
389+ };
384390
385391 // Allocate storage - note the AlignedStorage type so that deleter is correct if
386392 // an exception is thrown before we are initialized
You can’t perform that action at this time.
0 commit comments