Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/c++/11/experimental/type_traits
$ cat -n /usr/include/c++/11/experimental/type_traits 1 // Variable Templates For Type Traits -*- C++ -*- 2 3 // Copyright (C) 2014-2021 Free Software Foundation, Inc. 4 // 5 // This file is part of the GNU ISO C++ Library. This library is free 6 // software; you can redistribute it and/or modify it under the 7 // terms of the GNU General Public License as published by the 8 // Free Software Foundation; either version 3, or (at your option) 9 // any later version. 10 11 // This library is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU General Public License for more details. 15 16 // Under Section 7 of GPL version 3, you are granted additional 17 // permissions described in the GCC Runtime Library Exception, version 18 // 3.1, as published by the Free Software Foundation. 19 20 // You should have received a copy of the GNU General Public License and 21 // a copy of the GCC Runtime Library Exception along with this program; 22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 23 //
. 24 25 /** @file experimental/type_traits 26 * This is a TS C++ Library header. 27 * 28 * This header defines variable templates for the C++14 type traits. 29 * 30 * Equivalent variable templates are defined in namespace `std` since C++17. 31 * @see variable_templates 32 * 33 * @ingroup libfund-ts 34 * @since C++14 35 */ 36 37 // 38 // N3932 Variable Templates For Type Traits (Revision 1) 39 // 40 41 #ifndef _GLIBCXX_EXPERIMENTAL_TYPE_TRAITS 42 #define _GLIBCXX_EXPERIMENTAL_TYPE_TRAITS 1 43 44 #pragma GCC system_header 45 46 #if __cplusplus >= 201402L 47 48 #include
49 #include
50 51 namespace std _GLIBCXX_VISIBILITY(default) 52 { 53 _GLIBCXX_BEGIN_NAMESPACE_VERSION 54 55 namespace experimental 56 { 57 inline namespace fundamentals_v1 58 { 59 /** @defgroup lfts_variable_templates Variable template for type traits 60 * @ingroup libfund-ts 61 * @since Library Fundamentals TS v1. C++14. 62 * @see variable_templates 63 */ 64 /** @ingroup lfts_variable_templates 65 * @{ 66 */ 67 #define __cpp_lib_experimental_type_trait_variable_templates 201402 68 69 // See C++14 20.10.4.1, primary type categories 70 template
71 constexpr bool is_void_v = is_void<_Tp>::value; 72 template
73 constexpr bool is_null_pointer_v = is_null_pointer<_Tp>::value; 74 template
75 constexpr bool is_integral_v = is_integral<_Tp>::value; 76 template
77 constexpr bool is_floating_point_v = is_floating_point<_Tp>::value; 78 template
79 constexpr bool is_array_v = is_array<_Tp>::value; 80 template
81 constexpr bool is_pointer_v = is_pointer<_Tp>::value; 82 template
83 constexpr bool is_lvalue_reference_v = is_lvalue_reference<_Tp>::value; 84 template
85 constexpr bool is_rvalue_reference_v = is_rvalue_reference<_Tp>::value; 86 template
87 constexpr bool is_member_object_pointer_v = 88 is_member_object_pointer<_Tp>::value; 89 template
90 constexpr bool is_member_function_pointer_v = 91 is_member_function_pointer<_Tp>::value; 92 template
93 constexpr bool is_enum_v = is_enum<_Tp>::value; 94 template
95 constexpr bool is_union_v = is_union<_Tp>::value; 96 template
97 constexpr bool is_class_v = is_class<_Tp>::value; 98 template
99 constexpr bool is_function_v = is_function<_Tp>::value; 100 101 // See C++14 20.10.4.2, composite type categories 102 template
103 constexpr bool is_reference_v = is_reference<_Tp>::value; 104 template
105 constexpr bool is_arithmetic_v = is_arithmetic<_Tp>::value; 106 template
107 constexpr bool is_fundamental_v = is_fundamental<_Tp>::value; 108 template
109 constexpr bool is_object_v = is_object<_Tp>::value; 110 template
111 constexpr bool is_scalar_v = is_scalar<_Tp>::value; 112 template
113 constexpr bool is_compound_v = is_compound<_Tp>::value; 114 template
115 constexpr bool is_member_pointer_v = is_member_pointer<_Tp>::value; 116 117 // See C++14 20.10.4.3, type properties 118 template
119 constexpr bool is_const_v = is_const<_Tp>::value; 120 template
121 constexpr bool is_volatile_v = is_volatile<_Tp>::value; 122 template
123 constexpr bool is_trivial_v = is_trivial<_Tp>::value; 124 template
125 constexpr bool is_trivially_copyable_v = is_trivially_copyable<_Tp>::value; 126 template
127 constexpr bool is_standard_layout_v = is_standard_layout<_Tp>::value; 128 #pragma GCC diagnostic push 129 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 130 template
131 constexpr bool is_pod_v = is_pod<_Tp>::value; 132 template
133 constexpr bool is_literal_type_v = is_literal_type<_Tp>::value; 134 #pragma GCC diagnostic pop 135 template
136 constexpr bool is_empty_v = is_empty<_Tp>::value; 137 template
138 constexpr bool is_polymorphic_v = is_polymorphic<_Tp>::value; 139 template
140 constexpr bool is_abstract_v = is_abstract<_Tp>::value; 141 template
142 constexpr bool is_final_v = is_final<_Tp>::value; 143 template
144 constexpr bool is_signed_v = is_signed<_Tp>::value; 145 template
146 constexpr bool is_unsigned_v = is_unsigned<_Tp>::value; 147 template
148 constexpr bool is_constructible_v = is_constructible<_Tp, _Args...>::value; 149 template
150 constexpr bool is_default_constructible_v = 151 is_default_constructible<_Tp>::value; 152 template
153 constexpr bool is_copy_constructible_v = is_copy_constructible<_Tp>::value; 154 template
155 constexpr bool is_move_constructible_v = is_move_constructible<_Tp>::value; 156 template
157 constexpr bool is_assignable_v = is_assignable<_Tp, _Up>::value; 158 template
159 constexpr bool is_copy_assignable_v = is_copy_assignable<_Tp>::value; 160 template
161 constexpr bool is_move_assignable_v = is_move_assignable<_Tp>::value; 162 template
163 constexpr bool is_destructible_v = is_destructible<_Tp>::value; 164 template
165 constexpr bool is_trivially_constructible_v = 166 is_trivially_constructible<_Tp, _Args...>::value; 167 template
168 constexpr bool is_trivially_default_constructible_v = 169 is_trivially_default_constructible<_Tp>::value; 170 template
171 constexpr bool is_trivially_copy_constructible_v = 172 is_trivially_copy_constructible<_Tp>::value; 173 template
174 constexpr bool is_trivially_move_constructible_v = 175 is_trivially_move_constructible<_Tp>::value; 176 template
177 constexpr bool is_trivially_assignable_v = 178 is_trivially_assignable<_Tp, _Up>::value; 179 template
180 constexpr bool is_trivially_copy_assignable_v = 181 is_trivially_copy_assignable<_Tp>::value; 182 template
183 constexpr bool is_trivially_move_assignable_v = 184 is_trivially_move_assignable<_Tp>::value; 185 template
186 constexpr bool is_trivially_destructible_v = 187 is_trivially_destructible<_Tp>::value; 188 template
189 constexpr bool is_nothrow_constructible_v = 190 is_nothrow_constructible<_Tp, _Args...>::value; 191 template
192 constexpr bool is_nothrow_default_constructible_v = 193 is_nothrow_default_constructible<_Tp>::value; 194 template
195 constexpr bool is_nothrow_copy_constructible_v = 196 is_nothrow_copy_constructible<_Tp>::value; 197 template
198 constexpr bool is_nothrow_move_constructible_v = 199 is_nothrow_move_constructible<_Tp>::value; 200 template
201 constexpr bool is_nothrow_assignable_v = 202 is_nothrow_assignable<_Tp, _Up>::value; 203 template
204 constexpr bool is_nothrow_copy_assignable_v = 205 is_nothrow_copy_assignable<_Tp>::value; 206 template
207 constexpr bool is_nothrow_move_assignable_v = 208 is_nothrow_move_assignable<_Tp>::value; 209 template
210 constexpr bool is_nothrow_destructible_v = 211 is_nothrow_destructible<_Tp>::value; 212 template
213 constexpr bool has_virtual_destructor_v = 214 has_virtual_destructor<_Tp>::value; 215 216 // See C++14 20.10.5, type property queries 217 template
218 constexpr size_t alignment_of_v = alignment_of<_Tp>::value; 219 template
220 constexpr size_t rank_v = rank<_Tp>::value; 221 template
222 constexpr size_t extent_v = extent<_Tp, _Idx>::value; 223 224 // See C++14 20.10.6, type relations 225 template
226 constexpr bool is_same_v = is_same<_Tp, _Up>::value; 227 template
228 constexpr bool is_base_of_v = is_base_of<_Base, _Derived>::value; 229 template
230 constexpr bool is_convertible_v = is_convertible<_From, _To>::value; 231 /// @} 232 233 // 3.3.2, Other type transformations 234 // invocation_type (still unimplemented) 235 // raw_invocation_type (still unimplemented) 236 // invocation_type_t (still unimplemented) 237 // raw_invocation_type_t (still unimplemented) 238 } // namespace fundamentals_v1 239 240 inline namespace fundamentals_v2 241 { 242 /** 243 * @defgroup lfts_detect Detection idiom 244 * @ingroup libfund-ts 245 * @since Library Fundamentals TS v2. C++14. 246 */ 247 /** @ingroup lfts_detect 248 * @{ 249 */ 250 #define __cpp_lib_experimental_detect 201505 251 252 // [meta.detect] 253 254 /// A metafunction that always yields void, used for detecting valid types. 255 template
using void_t = void; 256 257 #pragma GCC diagnostic push 258 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy" 259 /// @internal 260 struct __nonesuchbase {}; 261 struct nonesuch : private __nonesuchbase 262 { 263 ~nonesuch() = delete; 264 nonesuch(nonesuch const&) = delete; 265 void operator=(nonesuch const&) = delete; 266 }; 267 #pragma GCC diagnostic pop 268 269 template
class _Op, typename... _Args> 270 using is_detected 271 = typename std::__detector
::value_t; 272 273 template
class _Op, typename... _Args> 274 constexpr bool is_detected_v = is_detected<_Op, _Args...>::value; 275 276 template
class _Op, typename... _Args> 277 using detected_t 278 = typename std::__detector
::type; 279 280 template
class _Op, typename... _Args> 281 using detected_or = std::__detected_or<_Default, _Op, _Args...>; 282 283 template
class _Op, typename... _Args> 284 using detected_or_t = typename detected_or<_Default, _Op, _Args...>::type; 285 286 template
class _Op, typename... _Args> 287 using is_detected_exact = is_same<_Expected, detected_t<_Op, _Args...>>; 288 289 template
class _Op, typename... _Args> 290 constexpr bool is_detected_exact_v 291 = is_detected_exact<_Expected, _Op, _Args...>::value; 292 293 template
class _Op, typename... _Args> 294 using is_detected_convertible 295 = is_convertible
, _To>; 296 297 template
class _Op, typename... _Args> 298 constexpr bool is_detected_convertible_v 299 = is_detected_convertible<_To, _Op, _Args...>::value; 300 /// @} 301 302 /** 303 * @defgroup lfts_logical Logical operator traits 304 * @ingroup libfund-ts 305 * @since Library Fundamentals TS v2. C++14. 306 */ 307 /** @ingroup lfts_logical 308 * @{ 309 */ 310 #define __cpp_lib_experimental_logical_traits 201511 311 312 template
313 struct conjunction 314 : __and_<_Bn...> 315 { }; 316 317 template
318 struct disjunction 319 : __or_<_Bn...> 320 { }; 321 322 template
323 struct negation 324 : __not_<_Pp> 325 { }; 326 327 template
328 constexpr bool conjunction_v 329 = conjunction<_Bn...>::value; 330 331 template
332 constexpr bool disjunction_v 333 = disjunction<_Bn...>::value; 334 335 template
336 constexpr bool negation_v 337 = negation<_Pp>::value; 338 /// @} 339 } // namespace fundamentals_v2 340 } // namespace experimental 341 342 _GLIBCXX_END_NAMESPACE_VERSION 343 } // namespace std 344 345 #endif // __cplusplus <= 201103L 346 347 #endif // _GLIBCXX_EXPERIMENTAL_TYPE_TRAITS
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™