| 1 | // -*- C++ -*- |
| 2 | //===----------------------------------------------------------------------===// |
| 3 | // |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 | // See https://llvm.org/LICENSE.txt for license information. |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef _LIBCPP_TYPE_TRAITS |
| 11 | #define _LIBCPP_TYPE_TRAITS |
| 12 | |
| 13 | /* |
| 14 | type_traits synopsis |
| 15 | |
| 16 | namespace std |
| 17 | { |
| 18 | |
| 19 | // helper class: |
| 20 | template <class T, T v> struct integral_constant; |
| 21 | typedef integral_constant<bool, true> true_type; // since C++11 |
| 22 | typedef integral_constant<bool, false> false_type; // since C++11 |
| 23 | |
| 24 | template <bool B> |
| 25 | using bool_constant = integral_constant<bool, B>; // since C++17 |
| 26 | |
| 27 | // helper traits |
| 28 | template <bool, class T = void> struct enable_if; |
| 29 | template <bool, class T, class F> struct conditional; |
| 30 | |
| 31 | // Primary classification traits: |
| 32 | template <class T> struct is_void; |
| 33 | template <class T> struct is_null_pointer; // since C++14 |
| 34 | template <class T> struct is_integral; |
| 35 | template <class T> struct is_floating_point; |
| 36 | template <class T> struct is_array; |
| 37 | template <class T> struct is_pointer; |
| 38 | template <class T> struct is_lvalue_reference; |
| 39 | template <class T> struct is_rvalue_reference; |
| 40 | template <class T> struct is_member_object_pointer; |
| 41 | template <class T> struct is_member_function_pointer; |
| 42 | template <class T> struct is_enum; |
| 43 | template <class T> struct is_union; |
| 44 | template <class T> struct is_class; |
| 45 | template <class T> struct is_function; |
| 46 | |
| 47 | // Secondary classification traits: |
| 48 | template <class T> struct is_reference; |
| 49 | template <class T> struct is_arithmetic; |
| 50 | template <class T> struct is_fundamental; |
| 51 | template <class T> struct is_member_pointer; |
| 52 | template <class T> struct is_scoped_enum; // since C++23 |
| 53 | template <class T> struct is_scalar; |
| 54 | template <class T> struct is_object; |
| 55 | template <class T> struct is_compound; |
| 56 | |
| 57 | // Const-volatile properties and transformations: |
| 58 | template <class T> struct is_const; |
| 59 | template <class T> struct is_volatile; |
| 60 | template <class T> struct remove_const; |
| 61 | template <class T> struct remove_volatile; |
| 62 | template <class T> struct remove_cv; |
| 63 | template <class T> struct add_const; |
| 64 | template <class T> struct add_volatile; |
| 65 | template <class T> struct add_cv; |
| 66 | |
| 67 | // Reference transformations: |
| 68 | template <class T> struct remove_reference; |
| 69 | template <class T> struct add_lvalue_reference; |
| 70 | template <class T> struct add_rvalue_reference; |
| 71 | |
| 72 | // Pointer transformations: |
| 73 | template <class T> struct remove_pointer; |
| 74 | template <class T> struct add_pointer; |
| 75 | |
| 76 | template<class T> struct type_identity; // since C++20 |
| 77 | template<class T> |
| 78 | using type_identity_t = typename type_identity<T>::type; // since C++20 |
| 79 | |
| 80 | // Integral properties: |
| 81 | template <class T> struct is_signed; |
| 82 | template <class T> struct is_unsigned; |
| 83 | template <class T> struct make_signed; |
| 84 | template <class T> struct make_unsigned; |
| 85 | |
| 86 | // Array properties and transformations: |
| 87 | template <class T> struct rank; |
| 88 | template <class T, unsigned I = 0> struct extent; |
| 89 | template <class T> struct remove_extent; |
| 90 | template <class T> struct remove_all_extents; |
| 91 | |
| 92 | template <class T> struct is_bounded_array; // since C++20 |
| 93 | template <class T> struct is_unbounded_array; // since C++20 |
| 94 | |
| 95 | // Member introspection: |
| 96 | template <class T> struct is_trivial; // deprecated in C++26 |
| 97 | template <class T> struct is_pod; // deprecated in C++20 |
| 98 | template <class T> struct is_trivially_copyable; |
| 99 | template <class T> struct is_standard_layout; |
| 100 | template <class T> struct is_literal_type; // deprecated in C++17; removed in C++20 |
| 101 | template <class T> struct is_empty; |
| 102 | template <class T> struct is_polymorphic; |
| 103 | template <class T> struct is_abstract; |
| 104 | template <class T> struct is_final; // since C++14 |
| 105 | template <class T> struct is_aggregate; // since C++17 |
| 106 | |
| 107 | template <class T, class... Args> struct is_constructible; |
| 108 | template <class T> struct is_default_constructible; |
| 109 | template <class T> struct is_copy_constructible; |
| 110 | template <class T> struct is_move_constructible; |
| 111 | template <class T, class U> struct is_assignable; |
| 112 | template <class T> struct is_copy_assignable; |
| 113 | template <class T> struct is_move_assignable; |
| 114 | template <class T, class U> struct is_swappable_with; // since C++17 |
| 115 | template <class T> struct is_swappable; // since C++17 |
| 116 | template <class T> struct is_destructible; |
| 117 | |
| 118 | template <class T, class... Args> struct is_trivially_constructible; |
| 119 | template <class T> struct is_trivially_default_constructible; |
| 120 | template <class T> struct is_trivially_copy_constructible; |
| 121 | template <class T> struct is_trivially_move_constructible; |
| 122 | template <class T, class U> struct is_trivially_assignable; |
| 123 | template <class T> struct is_trivially_copy_assignable; |
| 124 | template <class T> struct is_trivially_move_assignable; |
| 125 | template <class T> struct is_trivially_destructible; |
| 126 | |
| 127 | template <class T, class... Args> struct is_nothrow_constructible; |
| 128 | template <class T> struct is_nothrow_default_constructible; |
| 129 | template <class T> struct is_nothrow_copy_constructible; |
| 130 | template <class T> struct is_nothrow_move_constructible; |
| 131 | template <class T, class U> struct is_nothrow_assignable; |
| 132 | template <class T> struct is_nothrow_copy_assignable; |
| 133 | template <class T> struct is_nothrow_move_assignable; |
| 134 | template <class T, class U> |
| 135 | struct is_nothrow_swappable_with; // since C++17 |
| 136 | template <class T> |
| 137 | struct is_nothrow_swappable; // since C++17 |
| 138 | template <class T> struct is_nothrow_destructible; |
| 139 | |
| 140 | template <class T> struct is_implicit_lifetime; // since C++23 |
| 141 | |
| 142 | template <class T> struct has_virtual_destructor; |
| 143 | |
| 144 | template <class T> |
| 145 | struct has_unique_object_representations; // since C++17 |
| 146 | |
| 147 | template<class T, class U> |
| 148 | struct reference_constructs_from_temporary; // since C++23 |
| 149 | template<class T, class U> |
| 150 | struct reference_converts_from_temporary; // since C++23 |
| 151 | |
| 152 | // Relationships between types: |
| 153 | template <class T, class U> struct is_same; |
| 154 | template <class Base, class Derived> struct is_base_of; |
| 155 | template <class Base, class Derived> |
| 156 | struct is_virtual_base_of; // since C++26 |
| 157 | |
| 158 | template <class From, class To> struct is_convertible; |
| 159 | template <class From, class To> |
| 160 | struct is_nothrow_convertible; // since C++20 |
| 161 | |
| 162 | template <class Fn, class... ArgTypes> struct is_invocable; // since C++17 |
| 163 | template <class R, class Fn, class... ArgTypes> |
| 164 | struct is_invocable_r; // since C++17 |
| 165 | |
| 166 | template <class Fn, class... ArgTypes> |
| 167 | struct is_nothrow_invocable; // since C++17 |
| 168 | template <class R, class Fn, class... ArgTypes> |
| 169 | struct is_nothrow_invocable_r; // since C++17 |
| 170 | |
| 171 | // Alignment properties and transformations: |
| 172 | template <class T> struct alignment_of; |
| 173 | template <size_t Len, size_t Align = most_stringent_alignment_requirement> |
| 174 | struct aligned_storage; // deprecated in C++23 |
| 175 | template <size_t Len, class... Types> struct aligned_union; // deprecated in C++23 |
| 176 | template <class T> struct remove_cvref; // since C++20 |
| 177 | |
| 178 | template <class T> struct decay; |
| 179 | template <class... T> struct common_type; |
| 180 | template <class T> struct underlying_type; |
| 181 | template <class> struct result_of; // undefined; deprecated in C++17; removed in C++20 |
| 182 | template <class Fn, class... ArgTypes> |
| 183 | struct result_of<Fn(ArgTypes...)>; // deprecated in C++17; removed in C++20 |
| 184 | template <class Fn, class... ArgTypes> |
| 185 | struct invoke_result; // since C++17 |
| 186 | |
| 187 | // const-volatile modifications: |
| 188 | template <class T> |
| 189 | using remove_const_t = typename remove_const<T>::type; // since C++14 |
| 190 | template <class T> |
| 191 | using remove_volatile_t |
| 192 | = typename remove_volatile<T>::type; // since C++14 |
| 193 | template <class T> |
| 194 | using remove_cv_t = typename remove_cv<T>::type; // since C++14 |
| 195 | template <class T> |
| 196 | using add_const_t = typename add_const<T>::type; // since C++14 |
| 197 | template <class T> |
| 198 | using add_volatile_t = typename add_volatile<T>::type; // since C++14 |
| 199 | template <class T> |
| 200 | using add_cv_t = typename add_cv<T>::type; // since C++14 |
| 201 | |
| 202 | // reference modifications: |
| 203 | template <class T> |
| 204 | using remove_reference_t |
| 205 | = typename remove_reference<T>::type; // since C++14 |
| 206 | template <class T> |
| 207 | using add_lvalue_reference_t |
| 208 | = typename add_lvalue_reference<T>::type; // since C++14 |
| 209 | template <class T> |
| 210 | using add_rvalue_reference_t |
| 211 | = typename add_rvalue_reference<T>::type; // since C++14 |
| 212 | |
| 213 | // sign modifications: |
| 214 | template <class T> |
| 215 | using make_signed_t = typename make_signed<T>::type; // since C++14 |
| 216 | template <class T> |
| 217 | using make_unsigned_t = typename make_unsigned<T>::type; // since C++14 |
| 218 | |
| 219 | // array modifications: |
| 220 | template <class T> |
| 221 | using remove_extent_t |
| 222 | = typename remove_extent<T>::type; // since C++14 |
| 223 | template <class T> |
| 224 | using remove_all_extents_t |
| 225 | = typename remove_all_extents<T>::type; // since C++14 |
| 226 | |
| 227 | template <class T> |
| 228 | inline constexpr bool is_bounded_array_v |
| 229 | = is_bounded_array<T>::value; // since C++20 |
| 230 | inline constexpr bool is_unbounded_array_v |
| 231 | = is_unbounded_array<T>::value; // since C++20 |
| 232 | |
| 233 | // pointer modifications: |
| 234 | template <class T> |
| 235 | using remove_pointer_t |
| 236 | = typename remove_pointer<T>::type; // since C++14 |
| 237 | template <class T> |
| 238 | using add_pointer_t = typename add_pointer<T>::type; // since C++14 |
| 239 | |
| 240 | // other transformations: |
| 241 | template <size_t Len, size_t Align=default-alignment> |
| 242 | using aligned_storage_t |
| 243 | = typename aligned_storage<Len,Align>::type; // since C++14 |
| 244 | template <size_t Len, class... Types> |
| 245 | using aligned_union_t |
| 246 | = typename aligned_union<Len,Types...>::type; // since C++14 |
| 247 | template <class T> |
| 248 | using remove_cvref_t |
| 249 | = typename remove_cvref<T>::type; // since C++20 |
| 250 | template <class T> |
| 251 | using decay_t = typename decay<T>::type; // since C++14 |
| 252 | template <bool b, class T=void> |
| 253 | using enable_if_t = typename enable_if<b,T>::type; // since C++14 |
| 254 | template <bool b, class T, class F> |
| 255 | using conditional_t |
| 256 | = typename conditional<b,T,F>::type; // since C++14 |
| 257 | template <class... T> |
| 258 | using common_type_t |
| 259 | = typename common_type<T...>::type; // since C++14 |
| 260 | template <class T> |
| 261 | using underlying_type_t |
| 262 | = typename underlying_type<T>::type; // since C++14 |
| 263 | template <class T> |
| 264 | using result_of_t = typename result_of<T>::type; // since C++14; deprecated in C++17; removed in C++20 |
| 265 | template <class Fn, class... ArgTypes> |
| 266 | using invoke_result_t |
| 267 | = typename invoke_result<Fn, ArgTypes...>::type; // since C++17 |
| 268 | |
| 269 | template <class...> |
| 270 | using void_t = void; // since C++17 |
| 271 | |
| 272 | // See C++14 20.10.4.1, primary type categories |
| 273 | template <class T> inline constexpr bool is_void_v |
| 274 | = is_void<T>::value; // since C++17 |
| 275 | template <class T> inline constexpr bool is_null_pointer_v |
| 276 | = is_null_pointer<T>::value; // since C++17 |
| 277 | template <class T> inline constexpr bool is_integral_v |
| 278 | = is_integral<T>::value; // since C++17 |
| 279 | template <class T> inline constexpr bool is_floating_point_v |
| 280 | = is_floating_point<T>::value; // since C++17 |
| 281 | template <class T> inline constexpr bool is_array_v |
| 282 | = is_array<T>::value; // since C++17 |
| 283 | template <class T> inline constexpr bool is_pointer_v |
| 284 | = is_pointer<T>::value; // since C++17 |
| 285 | template <class T> inline constexpr bool is_lvalue_reference_v |
| 286 | = is_lvalue_reference<T>::value; // since C++17 |
| 287 | template <class T> inline constexpr bool is_rvalue_reference_v |
| 288 | = is_rvalue_reference<T>::value; // since C++17 |
| 289 | template <class T> inline constexpr bool is_member_object_pointer_v |
| 290 | = is_member_object_pointer<T>::value; // since C++17 |
| 291 | template <class T> inline constexpr bool is_member_function_pointer_v |
| 292 | = is_member_function_pointer<T>::value; // since C++17 |
| 293 | template <class T> inline constexpr bool is_enum_v |
| 294 | = is_enum<T>::value; // since C++17 |
| 295 | template <class T> inline constexpr bool is_union_v |
| 296 | = is_union<T>::value; // since C++17 |
| 297 | template <class T> inline constexpr bool is_class_v |
| 298 | = is_class<T>::value; // since C++17 |
| 299 | template <class T> inline constexpr bool is_function_v |
| 300 | = is_function<T>::value; // since C++17 |
| 301 | |
| 302 | // See C++14 20.10.4.2, composite type categories |
| 303 | template <class T> inline constexpr bool is_reference_v |
| 304 | = is_reference<T>::value; // since C++17 |
| 305 | template <class T> inline constexpr bool is_arithmetic_v |
| 306 | = is_arithmetic<T>::value; // since C++17 |
| 307 | template <class T> inline constexpr bool is_fundamental_v |
| 308 | = is_fundamental<T>::value; // since C++17 |
| 309 | template <class T> inline constexpr bool is_object_v |
| 310 | = is_object<T>::value; // since C++17 |
| 311 | template <class T> inline constexpr bool is_scalar_v |
| 312 | = is_scalar<T>::value; // since C++17 |
| 313 | template <class T> inline constexpr bool is_compound_v |
| 314 | = is_compound<T>::value; // since C++17 |
| 315 | template <class T> inline constexpr bool is_member_pointer_v |
| 316 | = is_member_pointer<T>::value; // since C++17 |
| 317 | template <class T> inline constexpr bool is_scoped_enum_v |
| 318 | = is_scoped_enum<T>::value; // since C++23 |
| 319 | |
| 320 | // See C++14 20.10.4.3, type properties |
| 321 | template <class T> inline constexpr bool is_const_v |
| 322 | = is_const<T>::value; // since C++17 |
| 323 | template <class T> inline constexpr bool is_volatile_v |
| 324 | = is_volatile<T>::value; // since C++17 |
| 325 | template <class T> inline constexpr bool is_trivial_v |
| 326 | = is_trivial<T>::value; // since C++17; deprecated in C++26 |
| 327 | template <class T> inline constexpr bool is_trivially_copyable_v |
| 328 | = is_trivially_copyable<T>::value; // since C++17 |
| 329 | template <class T> inline constexpr bool is_standard_layout_v |
| 330 | = is_standard_layout<T>::value; // since C++17 |
| 331 | template <class T> inline constexpr bool is_pod_v |
| 332 | = is_pod<T>::value; // since C++17; deprecated in C++20 |
| 333 | template <class T> inline constexpr bool is_literal_type_v |
| 334 | = is_literal_type<T>::value; // since C++17; deprecated in C++17; removed in C++20 |
| 335 | template <class T> inline constexpr bool is_empty_v |
| 336 | = is_empty<T>::value; // since C++17 |
| 337 | template <class T> inline constexpr bool is_polymorphic_v |
| 338 | = is_polymorphic<T>::value; // since C++17 |
| 339 | template <class T> inline constexpr bool is_abstract_v |
| 340 | = is_abstract<T>::value; // since C++17 |
| 341 | template <class T> inline constexpr bool is_final_v |
| 342 | = is_final<T>::value; // since C++17 |
| 343 | template <class T> inline constexpr bool is_aggregate_v |
| 344 | = is_aggregate<T>::value; // since C++17 |
| 345 | template <class T> inline constexpr bool is_signed_v |
| 346 | = is_signed<T>::value; // since C++17 |
| 347 | template <class T> inline constexpr bool is_unsigned_v |
| 348 | = is_unsigned<T>::value; // since C++17 |
| 349 | template <class T, class... Args> inline constexpr bool is_constructible_v |
| 350 | = is_constructible<T, Args...>::value; // since C++17 |
| 351 | template <class T> inline constexpr bool is_default_constructible_v |
| 352 | = is_default_constructible<T>::value; // since C++17 |
| 353 | template <class T> inline constexpr bool is_copy_constructible_v |
| 354 | = is_copy_constructible<T>::value; // since C++17 |
| 355 | template <class T> inline constexpr bool is_move_constructible_v |
| 356 | = is_move_constructible<T>::value; // since C++17 |
| 357 | template <class T, class U> inline constexpr bool is_assignable_v |
| 358 | = is_assignable<T, U>::value; // since C++17 |
| 359 | template <class T> inline constexpr bool is_copy_assignable_v |
| 360 | = is_copy_assignable<T>::value; // since C++17 |
| 361 | template <class T> inline constexpr bool is_move_assignable_v |
| 362 | = is_move_assignable<T>::value; // since C++17 |
| 363 | template <class T, class U> inline constexpr bool is_swappable_with_v |
| 364 | = is_swappable_with<T, U>::value; // since C++17 |
| 365 | template <class T> inline constexpr bool is_swappable_v |
| 366 | = is_swappable<T>::value; // since C++17 |
| 367 | template <class T> inline constexpr bool is_destructible_v |
| 368 | = is_destructible<T>::value; // since C++17 |
| 369 | template <class T, class... Args> inline constexpr bool is_trivially_constructible_v |
| 370 | = is_trivially_constructible<T, Args...>::value; // since C++17 |
| 371 | template <class T> inline constexpr bool is_trivially_default_constructible_v |
| 372 | = is_trivially_default_constructible<T>::value; // since C++17 |
| 373 | template <class T> inline constexpr bool is_trivially_copy_constructible_v |
| 374 | = is_trivially_copy_constructible<T>::value; // since C++17 |
| 375 | template <class T> inline constexpr bool is_trivially_move_constructible_v |
| 376 | = is_trivially_move_constructible<T>::value; // since C++17 |
| 377 | template <class T, class U> inline constexpr bool is_trivially_assignable_v |
| 378 | = is_trivially_assignable<T, U>::value; // since C++17 |
| 379 | template <class T> inline constexpr bool is_trivially_copy_assignable_v |
| 380 | = is_trivially_copy_assignable<T>::value; // since C++17 |
| 381 | template <class T> inline constexpr bool is_trivially_move_assignable_v |
| 382 | = is_trivially_move_assignable<T>::value; // since C++17 |
| 383 | template <class T> inline constexpr bool is_trivially_destructible_v |
| 384 | = is_trivially_destructible<T>::value; // since C++17 |
| 385 | template <class T, class... Args> inline constexpr bool is_nothrow_constructible_v |
| 386 | = is_nothrow_constructible<T, Args...>::value; // since C++17 |
| 387 | template <class T> inline constexpr bool is_nothrow_default_constructible_v |
| 388 | = is_nothrow_default_constructible<T>::value; // since C++17 |
| 389 | template <class T> inline constexpr bool is_nothrow_copy_constructible_v |
| 390 | = is_nothrow_copy_constructible<T>::value; // since C++17 |
| 391 | template <class T> inline constexpr bool is_nothrow_move_constructible_v |
| 392 | = is_nothrow_move_constructible<T>::value; // since C++17 |
| 393 | template <class T, class U> inline constexpr bool is_nothrow_assignable_v |
| 394 | = is_nothrow_assignable<T, U>::value; // since C++17 |
| 395 | template <class T> inline constexpr bool is_nothrow_copy_assignable_v |
| 396 | = is_nothrow_copy_assignable<T>::value; // since C++17 |
| 397 | template <class T> inline constexpr bool is_nothrow_move_assignable_v |
| 398 | = is_nothrow_move_assignable<T>::value; // since C++17 |
| 399 | template <class T, class U> inline constexpr bool is_nothrow_swappable_with_v |
| 400 | = is_nothrow_swappable_with<T, U>::value; // since C++17 |
| 401 | template <class T> inline constexpr bool is_nothrow_swappable_v |
| 402 | = is_nothrow_swappable<T>::value; // since C++17 |
| 403 | template <class T> inline constexpr bool is_nothrow_destructible_v |
| 404 | = is_nothrow_destructible<T>::value; // since C++17 |
| 405 | template <class T> inline constexpr bool is_implicit_lifetime_v |
| 406 | = is_implicit_lifetime<T>::value; // since C++23 |
| 407 | template <class T> inline constexpr bool has_virtual_destructor_v |
| 408 | = has_virtual_destructor<T>::value; // since C++17 |
| 409 | template<class T> inline constexpr bool has_unique_object_representations_v |
| 410 | = has_unique_object_representations<T>::value; // since C++17 |
| 411 | template<class T, class U> |
| 412 | constexpr bool reference_constructs_from_temporary_v |
| 413 | = reference_constructs_from_temporary<T, U>::value; // since C++23 |
| 414 | template<class T, class U> |
| 415 | constexpr bool reference_converts_from_temporary_v |
| 416 | = reference_converts_from_temporary<T, U>::value; // since C++23 |
| 417 | |
| 418 | // See C++14 20.10.5, type property queries |
| 419 | template <class T> inline constexpr size_t alignment_of_v |
| 420 | = alignment_of<T>::value; // since C++17 |
| 421 | template <class T> inline constexpr size_t rank_v |
| 422 | = rank<T>::value; // since C++17 |
| 423 | template <class T, unsigned I = 0> inline constexpr size_t extent_v |
| 424 | = extent<T, I>::value; // since C++17 |
| 425 | |
| 426 | // See C++14 20.10.6, type relations |
| 427 | template <class T, class U> inline constexpr bool is_same_v |
| 428 | = is_same<T, U>::value; // since C++17 |
| 429 | template <class Base, class Derived> inline constexpr bool is_base_of_v |
| 430 | = is_base_of<Base, Derived>::value; // since C++17 |
| 431 | template <class Base, class Derived> inline constexpr bool is_virtual_base_of_v |
| 432 | = is_virtual_base_of<Base, Derived>::value; // since C++26 |
| 433 | template <class From, class To> inline constexpr bool is_convertible_v |
| 434 | = is_convertible<From, To>::value; // since C++17 |
| 435 | template <class From, class To> inline constexpr bool is_nothrow_convertible_v |
| 436 | = is_nothrow_convertible<From, To>::value; // since C++20 |
| 437 | template <class Fn, class... ArgTypes> inline constexpr bool is_invocable_v |
| 438 | = is_invocable<Fn, ArgTypes...>::value; // since C++17 |
| 439 | template <class R, class Fn, class... ArgTypes> inline constexpr bool is_invocable_r_v |
| 440 | = is_invocable_r<R, Fn, ArgTypes...>::value; // since C++17 |
| 441 | template <class Fn, class... ArgTypes> inline constexpr bool is_nothrow_invocable_v |
| 442 | = is_nothrow_invocable<Fn, ArgTypes...>::value; // since C++17 |
| 443 | template <class R, class Fn, class... ArgTypes> inline constexpr bool is_nothrow_invocable_r_v |
| 444 | = is_nothrow_invocable_r<R, Fn, ArgTypes...>::value; // since C++17 |
| 445 | |
| 446 | // [meta.logical], logical operator traits: |
| 447 | template<class... B> struct conjunction; // since C++17 |
| 448 | template<class... B> inline constexpr bool conjunction_v |
| 449 | = conjunction<B...>::value; // since C++17 |
| 450 | template<class... B> struct disjunction; // since C++17 |
| 451 | template<class... B> inline constexpr bool disjunction_v |
| 452 | = disjunction<B...>::value; // since C++17 |
| 453 | template<class B> struct negation; // since C++17 |
| 454 | template<class B> inline constexpr bool negation_v |
| 455 | = negation<B>::value; // since C++17 |
| 456 | |
| 457 | // [meta.const.eval], constant evaluation context |
| 458 | constexpr bool is_constant_evaluated() noexcept; // C++20 |
| 459 | template<class T> |
| 460 | consteval bool is_within_lifetime(const T*) noexcept; // C++26 |
| 461 | } |
| 462 | |
| 463 | */ |
| 464 | |
| 465 | #if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) |
| 466 | # include <__cxx03/type_traits> |
| 467 | #else |
| 468 | # include <__config> |
| 469 | # include <__type_traits/add_cv_quals.h> |
| 470 | # include <__type_traits/add_pointer.h> |
| 471 | # include <__type_traits/add_reference.h> |
| 472 | # include <__type_traits/aligned_storage.h> |
| 473 | # include <__type_traits/aligned_union.h> |
| 474 | # include <__type_traits/alignment_of.h> |
| 475 | # include <__type_traits/common_type.h> |
| 476 | # include <__type_traits/conditional.h> |
| 477 | # include <__type_traits/decay.h> |
| 478 | # include <__type_traits/enable_if.h> |
| 479 | # include <__type_traits/extent.h> |
| 480 | # include <__type_traits/has_virtual_destructor.h> |
| 481 | # include <__type_traits/integral_constant.h> |
| 482 | # include <__type_traits/is_abstract.h> |
| 483 | # include <__type_traits/is_arithmetic.h> |
| 484 | # include <__type_traits/is_array.h> |
| 485 | # include <__type_traits/is_assignable.h> |
| 486 | # include <__type_traits/is_base_of.h> |
| 487 | # include <__type_traits/is_class.h> |
| 488 | # include <__type_traits/is_compound.h> |
| 489 | # include <__type_traits/is_const.h> |
| 490 | # include <__type_traits/is_constructible.h> |
| 491 | # include <__type_traits/is_convertible.h> |
| 492 | # include <__type_traits/is_destructible.h> |
| 493 | # include <__type_traits/is_empty.h> |
| 494 | # include <__type_traits/is_enum.h> |
| 495 | # include <__type_traits/is_floating_point.h> |
| 496 | # include <__type_traits/is_function.h> |
| 497 | # include <__type_traits/is_fundamental.h> |
| 498 | # include <__type_traits/is_integral.h> |
| 499 | # include <__type_traits/is_literal_type.h> |
| 500 | # include <__type_traits/is_member_pointer.h> |
| 501 | # include <__type_traits/is_nothrow_assignable.h> |
| 502 | # include <__type_traits/is_nothrow_constructible.h> |
| 503 | # include <__type_traits/is_nothrow_destructible.h> |
| 504 | # include <__type_traits/is_object.h> |
| 505 | # include <__type_traits/is_pod.h> |
| 506 | # include <__type_traits/is_pointer.h> |
| 507 | # include <__type_traits/is_polymorphic.h> |
| 508 | # include <__type_traits/is_reference.h> |
| 509 | # include <__type_traits/is_same.h> |
| 510 | # include <__type_traits/is_scalar.h> |
| 511 | # include <__type_traits/is_signed.h> |
| 512 | # include <__type_traits/is_standard_layout.h> |
| 513 | # include <__type_traits/is_trivial.h> |
| 514 | # include <__type_traits/is_trivially_assignable.h> |
| 515 | # include <__type_traits/is_trivially_constructible.h> |
| 516 | # include <__type_traits/is_trivially_copyable.h> |
| 517 | # include <__type_traits/is_trivially_destructible.h> |
| 518 | # include <__type_traits/is_union.h> |
| 519 | # include <__type_traits/is_unsigned.h> |
| 520 | # include <__type_traits/is_void.h> |
| 521 | # include <__type_traits/is_volatile.h> |
| 522 | # include <__type_traits/make_signed.h> |
| 523 | # include <__type_traits/make_unsigned.h> |
| 524 | # include <__type_traits/rank.h> |
| 525 | # include <__type_traits/remove_all_extents.h> |
| 526 | # include <__type_traits/remove_const.h> |
| 527 | # include <__type_traits/remove_cv.h> |
| 528 | # include <__type_traits/remove_extent.h> |
| 529 | # include <__type_traits/remove_pointer.h> |
| 530 | # include <__type_traits/remove_reference.h> |
| 531 | # include <__type_traits/remove_volatile.h> |
| 532 | # include <__type_traits/result_of.h> |
| 533 | # include <__type_traits/underlying_type.h> |
| 534 | |
| 535 | # if _LIBCPP_STD_VER >= 14 |
| 536 | # include <__type_traits/is_final.h> |
| 537 | # include <__type_traits/is_null_pointer.h> |
| 538 | # endif |
| 539 | |
| 540 | # if _LIBCPP_STD_VER >= 17 |
| 541 | # include <__type_traits/conjunction.h> |
| 542 | # include <__type_traits/disjunction.h> |
| 543 | # include <__type_traits/has_unique_object_representation.h> |
| 544 | # include <__type_traits/invoke.h> |
| 545 | # include <__type_traits/is_aggregate.h> |
| 546 | # include <__type_traits/is_swappable.h> |
| 547 | # include <__type_traits/negation.h> |
| 548 | # include <__type_traits/void_t.h> |
| 549 | # endif |
| 550 | |
| 551 | # if _LIBCPP_STD_VER >= 20 |
| 552 | # include <__type_traits/common_reference.h> |
| 553 | # include <__type_traits/is_constant_evaluated.h> |
| 554 | # include <__type_traits/type_identity.h> |
| 555 | # include <__type_traits/unwrap_ref.h> |
| 556 | # endif |
| 557 | |
| 558 | # if _LIBCPP_STD_VER >= 23 |
| 559 | # include <__type_traits/is_implicit_lifetime.h> |
| 560 | # include <__type_traits/reference_constructs_from_temporary.h> |
| 561 | # include <__type_traits/reference_converts_from_temporary.h> |
| 562 | # endif |
| 563 | |
| 564 | # if _LIBCPP_STD_VER >= 26 |
| 565 | # include <__type_traits/is_within_lifetime.h> |
| 566 | # endif |
| 567 | |
| 568 | # include <version> |
| 569 | |
| 570 | # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| 571 | # pragma GCC system_header |
| 572 | # endif |
| 573 | #endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) |
| 574 | |
| 575 | #endif // _LIBCPP_TYPE_TRAITS |