@@ -31,6 +31,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3131
3232namespace xyz {
3333
34+ #ifndef XYZ_TYPE_IDENTITY_DEFINED
35+ #define XYZ_TYPE_IDENTITY_DEFINED
36+ #ifdef XYZ_HAS_STD_TYPE_IDENTITY
37+ using std::type_identity_t ;
38+ #else
39+ template <class T >
40+ struct type_identity { using type = T; };
41+ template <class T >
42+ using type_identity_t = typename type_identity<T>::type;
43+ #endif // XYZ_HAS_STD_TYPE_IDENTITY
44+ #endif // XYZ_TYPE_IDENTITY_DEFINED
45+
3446#ifndef XYZ_UNREACHABLE_DEFINED
3547#define XYZ_UNREACHABLE_DEFINED
3648
@@ -182,7 +194,7 @@ class indirect {
182194 p_ = construct_from (alloc_, ilist, std::forward<Us>(us)...);
183195 }
184196
185- constexpr indirect (std::allocator_arg_t , const std ::type_identity_t <A>& alloc,
197+ constexpr indirect (std::allocator_arg_t , const xyz ::type_identity_t <A>& alloc,
186198 const indirect& other)
187199 : alloc_(alloc) {
188200 static_assert (std::copy_constructible<T>);
@@ -195,7 +207,7 @@ class indirect {
195207 }
196208
197209 constexpr indirect (
198- std::allocator_arg_t , const std ::type_identity_t <A>& alloc,
210+ std::allocator_arg_t , const xyz ::type_identity_t <A>& alloc,
199211 indirect&& other) noexcept (allocator_traits::is_always_equal::value)
200212 : p_(nullptr ), alloc_(alloc) {
201213 static_assert (std::move_constructible<T>);
@@ -465,16 +477,12 @@ concept is_hashable = requires(T t) { std::hash<T>{}(t); };
465477template <typename Value>
466478indirect (Value) -> indirect<Value>;
467479
468- template <typename Alloc, typename Value,
469- typename std::enable_if_t <!is_indirect_v<Value>, int > = 0 >
470- indirect (std::allocator_arg_t , Alloc, Value) -> indirect<
471- Value, typename std::allocator_traits<Alloc>::template rebind_alloc<Value>>;
472-
473- #ifdef XYZ_HAS_EXTENDED_CONSTRUCTOR_TEMPLATE_ARGUMENT_DEDUCTION
474480template <typename Alloc, typename Value>
475- indirect (std::allocator_arg_t , std::type_identity_t <Alloc>,
481+ indirect (std::allocator_arg_t , Alloc, Value) -> indirect<Value, Alloc>;
482+
483+ template <typename Alloc, typename Alloc2, typename Value>
484+ indirect (std::allocator_arg_t , Alloc2,
476485 indirect<Value, Alloc>) -> indirect<Value, Alloc>;
477- #endif // XYZ_HAS_EXTENDED_CONSTRUCTOR_TEMPLATE_ARGUMENT_DEDUCTION
478486
479487} // namespace xyz
480488
0 commit comments