@@ -70,13 +70,51 @@ struct const_pointer_or_const_ref<T,
70
70
};
71
71
72
72
namespace detail {
73
+ // / Internal utility to detect trivial copy construction.
74
+ template <typename T> union copy_construction_triviality_helper {
75
+ T t;
76
+ copy_construction_triviality_helper () = default ;
77
+ copy_construction_triviality_helper (const copy_construction_triviality_helper&) = default ;
78
+ ~copy_construction_triviality_helper () = default ;
79
+ };
80
+ // / Internal utility to detect trivial move construction.
81
+ template <typename T> union move_construction_triviality_helper {
82
+ T t;
83
+ move_construction_triviality_helper () = default ;
84
+ move_construction_triviality_helper (move_construction_triviality_helper&&) = default ;
85
+ ~move_construction_triviality_helper () = default ;
86
+ };
87
+
73
88
template <class T >
74
89
union trivial_helper {
75
90
T t;
76
91
};
77
92
78
93
} // end namespace detail
79
94
95
+ // / An implementation of `std::is_trivially_copy_constructible` since we have
96
+ // / users with STLs that don't yet include it.
97
+ template <typename T>
98
+ struct is_trivially_copy_constructible
99
+ : std::is_copy_constructible<
100
+ ::llvm::detail::copy_construction_triviality_helper<T>> {};
101
+ template <typename T>
102
+ struct is_trivially_copy_constructible <T &> : std::true_type {};
103
+ template <typename T>
104
+ struct is_trivially_copy_constructible <T &&> : std::false_type {};
105
+
106
+ // / An implementation of `std::is_trivially_move_constructible` since we have
107
+ // / users with STLs that don't yet include it.
108
+ template <typename T>
109
+ struct is_trivially_move_constructible
110
+ : std::is_move_constructible<
111
+ ::llvm::detail::move_construction_triviality_helper<T>> {};
112
+ template <typename T>
113
+ struct is_trivially_move_constructible <T &> : std::true_type {};
114
+ template <typename T>
115
+ struct is_trivially_move_constructible <T &&> : std::true_type {};
116
+
117
+
80
118
template <typename T>
81
119
struct is_copy_assignable {
82
120
template <class F >
0 commit comments