@@ -120,6 +120,9 @@ template<class _Tp> inline constexpr bool is_arithmetic_v = is_arithmetic<_Tp>::
120120template <class _Tp > using is_fundamental = disjunction<is_void<_Tp>, is_null_pointer<_Tp>, is_arithmetic<_Tp>>;
121121template <class _Tp > inline constexpr bool is_fundamental_v = is_fundamental<_Tp>::value;
122122
123+ template <class _Tp > struct is_compound : std::integral_constant<bool , !std::is_fundamental<_Tp>::value> {};
124+ template <class _Tp > inline constexpr bool is_compound_v = is_compound<_Tp>::value;
125+
123126template <class _Tp , bool = is_arithmetic<_Tp>::value> struct __is_signed : integral_constant<bool , _Tp(-1 ) < _Tp(0 )> {};
124127template <class _Tp > struct __is_signed <_Tp, false > : false_type {};
125128template <class _Tp > struct is_signed : __is_signed<_Tp>::type {};
@@ -150,6 +153,41 @@ template<class _Tp> inline constexpr bool is_class_v = __is_class(_Tp);
150153template <class _Tp > using is_class = bool_constant<is_class_v<_Tp>>;
151154#endif
152155
156+ #if __has_feature(is_trivial)
157+ template <class _Tp > inline constexpr bool is_trivial_v = __is_trivial(_Tp);
158+ template <class _Tp > using is_trivial = bool_constant<is_trivial_v<_Tp>>;
159+ #endif
160+
161+ #if __has_feature(is_trivially_copyable)
162+ template <class _Tp > inline constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Tp);
163+ template <class _Tp > using is_trivially_copyable = bool_constant<is_trivially_copyable_v<_Tp>>;
164+ #endif
165+
166+ #if __has_feature(is_standard_layout)
167+ template <class _Tp > inline constexpr bool is_standard_layout_v = __is_standard_layout(_Tp);
168+ template <class _Tp > using is_standard_layout = bool_constant<is_standard_layout_v<_Tp>>;
169+ #endif
170+
171+ #if __has_feature(is_pod)
172+ template <class _Tp > inline constexpr bool is_pod_v = __is_pod(_Tp);
173+ template <class _Tp > using is_pod = bool_constant<is_pod_v<_Tp>>;
174+ #endif
175+
176+ #if __has_feature(is_empty)
177+ template <class _Tp > inline constexpr bool is_empty_v = __is_empty(_Tp);
178+ template <class _Tp > using is_empty = bool_constant<is_empty_v<_Tp>>;
179+ #endif
180+
181+ #if __has_feature(is_polymorphic)
182+ template <class _Tp > inline constexpr bool is_polymorphic_v = __is_polymorphic(_Tp);
183+ template <class _Tp > using is_polymorphic = bool_constant<is_polymorphic_v<_Tp>>;
184+ #endif
185+
186+ #if __has_feature(is_abstract)
187+ template <class _Tp > inline constexpr bool is_abstract_v = __is_abstract(_Tp);
188+ template <class _Tp > using is_abstract = bool_constant<is_abstract_v<_Tp>>;
189+ #endif
190+
153191template <class > struct is_pointer : false_type {};
154192template <class _Tp > struct is_pointer <_Tp*> : true_type {};
155193template <class _Tp > inline constexpr bool is_pointer_v = is_pointer<_Tp>::value;
@@ -183,6 +221,23 @@ template<class _Tp, class _Cp> struct __member_object_pointer<_Tp _Cp::*> : nega
183221template <class _Tp > using is_member_object_pointer = __member_object_pointer<remove_cv_t <_Tp>>;
184222template <class _Tp > inline constexpr bool is_member_object_pointer_v = is_member_object_pointer<_Tp>::value;
185223
224+ template <class _Tp > struct is_scalar : public integral_constant <bool ,
225+ is_arithmetic<_Tp>::value ||
226+ is_member_pointer<_Tp>::value ||
227+ is_pointer<_Tp>::value ||
228+ is_null_pointer<_Tp>::value ||
229+ is_enum<_Tp>::value
230+ > {};
231+ template <class _Tp > inline constexpr bool is_scalar_v = is_scalar<_Tp>::value;
232+
233+ template <class _Tp > struct is_object : integral_constant<bool ,
234+ is_scalar<_Tp>::value ||
235+ is_array<_Tp>::value ||
236+ is_union<_Tp>::value ||
237+ is_class<_Tp>::value
238+ > {};
239+ template <class _Tp > inline constexpr bool is_object_v = is_object<_Tp>::value;
240+
186241// const/volatile addition traits:
187242template <class _Tp > using add_const = conditional<disjunction_v<is_reference<_Tp>, is_function<_Tp>, is_const<_Tp>>,
188243 _Tp, _Tp const >;
0 commit comments