|
1 | 1 | /* |
2 | 2 | Copyright (c) 2005-2023 Intel Corporation |
| 3 | + Copyright (c) 2026 UXL Foundation Contributors |
3 | 4 |
|
4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 6 | you may not use this file except in compliance with the License. |
@@ -117,19 +118,19 @@ struct UnorderedMoveTraitsBase { |
117 | 118 | static constexpr std::size_t expected_number_of_items_to_allocate_for_steal_move = 3; // TODO: check |
118 | 119 |
|
119 | 120 | template <typename UnorderedType, typename Iterator> |
120 | | - static UnorderedType& construct_container( typename std::aligned_storage<sizeof(UnorderedType)>::type& storage, |
| 121 | + static UnorderedType& construct_container( utils::UninitializedStorage<UnorderedType>& storage, |
121 | 122 | Iterator begin, Iterator end ) |
122 | 123 | { |
123 | | - UnorderedType* ptr = reinterpret_cast<UnorderedType*>(&storage); |
| 124 | + UnorderedType* ptr = &storage; |
124 | 125 | new (ptr) UnorderedType(begin, end); |
125 | 126 | return *ptr; |
126 | 127 | } |
127 | 128 |
|
128 | 129 | template <typename UnorderedType, typename Iterator, typename Allocator> |
129 | | - static UnorderedType& construct_container( typename std::aligned_storage<sizeof(UnorderedType)>::type& storage, |
130 | | - Iterator begin, Iterator end, const Allocator& alloc ) |
| 130 | + static UnorderedType& construct_container( utils::UninitializedStorage<UnorderedType>& storage, |
| 131 | + Iterator begin, Iterator end, const Allocator& alloc ) |
131 | 132 | { |
132 | | - UnorderedType* ptr = reinterpret_cast<UnorderedType*>(&storage); |
| 133 | + UnorderedType* ptr = &storage; |
133 | 134 | new (ptr) UnorderedType(begin, end, /*bucket_count = */4, alloc); |
134 | 135 | return *ptr; |
135 | 136 | } |
|
0 commit comments