Coverage Report

Created: 2020-02-25 14:32

/Users/buildslave/jenkins/workspace/coverage/llvm-project/libcxx/include/type_traits
Line
Count
Source (jump to first uncovered line)
1
// -*- C++ -*-
2
//===------------------------ type_traits ---------------------------------===//
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;   // C++11
22
    typedef integral_constant<bool, false> false_type;  // C++11
23
24
    template <bool B>                                   // C++14
25
    using bool_constant = integral_constant<bool, B>;   // C++14
26
    typedef bool_constant<true> true_type;              // C++14
27
    typedef bool_constant<false> false_type;            // C++14
28
29
    // helper traits
30
    template <bool, class T = void> struct enable_if;
31
    template <bool, class T, class F> struct conditional;
32
33
    // Primary classification traits:
34
    template <class T> struct is_void;
35
    template <class T> struct is_null_pointer;  // C++14
36
    template <class T> struct is_integral;
37
    template <class T> struct is_floating_point;
38
    template <class T> struct is_array;
39
    template <class T> struct is_pointer;
40
    template <class T> struct is_lvalue_reference;
41
    template <class T> struct is_rvalue_reference;
42
    template <class T> struct is_member_object_pointer;
43
    template <class T> struct is_member_function_pointer;
44
    template <class T> struct is_enum;
45
    template <class T> struct is_union;
46
    template <class T> struct is_class;
47
    template <class T> struct is_function;
48
49
    // Secondary classification traits:
50
    template <class T> struct is_reference;
51
    template <class T> struct is_arithmetic;
52
    template <class T> struct is_fundamental;
53
    template <class T> struct is_member_pointer;
54
    template <class T> struct is_scalar;
55
    template <class T> struct is_object;
56
    template <class T> struct is_compound;
57
58
    // Const-volatile properties and transformations:
59
    template <class T> struct is_const;
60
    template <class T> struct is_volatile;
61
    template <class T> struct remove_const;
62
    template <class T> struct remove_volatile;
63
    template <class T> struct remove_cv;
64
    template <class T> struct add_const;
65
    template <class T> struct add_volatile;
66
    template <class T> struct add_cv;
67
68
    // Reference transformations:
69
    template <class T> struct remove_reference;
70
    template <class T> struct add_lvalue_reference;
71
    template <class T> struct add_rvalue_reference;
72
73
    // Pointer transformations:
74
    template <class T> struct remove_pointer;
75
    template <class T> struct add_pointer;
76
77
    template<class T> struct type_identity;                     // C++20
78
    template<class T>
79
      using type_identity_t = typename type_identity<T>::type;  // C++20
80
81
    // Integral properties:
82
    template <class T> struct is_signed;
83
    template <class T> struct is_unsigned;
84
    template <class T> struct make_signed;
85
    template <class T> struct make_unsigned;
86
87
    // Array properties and transformations:
88
    template <class T> struct rank;
89
    template <class T, unsigned I = 0> struct extent;
90
    template <class T> struct remove_extent;
91
    template <class T> struct remove_all_extents;
92
93
    template <class T> struct is_bounded_array;                 // C++20
94
    template <class T> struct is_unbounded_array;               // C++20
95
96
    // Member introspection:
97
    template <class T> struct is_pod;
98
    template <class T> struct is_trivial;
99
    template <class T> struct is_trivially_copyable;
100
    template <class T> struct is_standard_layout;
101
    template <class T> struct is_literal_type;
102
    template <class T> struct is_empty;
103
    template <class T> struct is_polymorphic;
104
    template <class T> struct is_abstract;
105
    template <class T> struct is_final; // C++14
106
    template <class T> struct is_aggregate; // C++17
107
108
    template <class T, class... Args> struct is_constructible;
109
    template <class T>                struct is_default_constructible;
110
    template <class T>                struct is_copy_constructible;
111
    template <class T>                struct is_move_constructible;
112
    template <class T, class U>       struct is_assignable;
113
    template <class T>                struct is_copy_assignable;
114
    template <class T>                struct is_move_assignable;
115
    template <class T, class U>       struct is_swappable_with;       // C++17
116
    template <class T>                struct is_swappable;            // C++17
117
    template <class T>                struct is_destructible;
118
119
    template <class T, class... Args> struct is_trivially_constructible;
120
    template <class T>                struct is_trivially_default_constructible;
121
    template <class T>                struct is_trivially_copy_constructible;
122
    template <class T>                struct is_trivially_move_constructible;
123
    template <class T, class U>       struct is_trivially_assignable;
124
    template <class T>                struct is_trivially_copy_assignable;
125
    template <class T>                struct is_trivially_move_assignable;
126
    template <class T>                struct is_trivially_destructible;
127
128
    template <class T, class... Args> struct is_nothrow_constructible;
129
    template <class T>                struct is_nothrow_default_constructible;
130
    template <class T>                struct is_nothrow_copy_constructible;
131
    template <class T>                struct is_nothrow_move_constructible;
132
    template <class T, class U>       struct is_nothrow_assignable;
133
    template <class T>                struct is_nothrow_copy_assignable;
134
    template <class T>                struct is_nothrow_move_assignable;
135
    template <class T, class U>       struct is_nothrow_swappable_with; // C++17
136
    template <class T>                struct is_nothrow_swappable;      // C++17
137
    template <class T>                struct is_nothrow_destructible;
138
139
    template <class T> struct has_virtual_destructor;
140
141
    template<class T> struct has_unique_object_representations;         // C++17
142
143
    // Relationships between types:
144
    template <class T, class U> struct is_same;
145
    template <class Base, class Derived> struct is_base_of;
146
147
    template <class From, class To> struct is_convertible;
148
    template <typename From, typename To> struct is_nothrow_convertible;                  // C++20
149
    template <typename From, typename To> inline constexpr bool is_nothrow_convertible_v; // C++20
150
151
    template <class Fn, class... ArgTypes> struct is_invocable;
152
    template <class R, class Fn, class... ArgTypes> struct is_invocable_r;
153
154
    template <class Fn, class... ArgTypes> struct is_nothrow_invocable;
155
    template <class R, class Fn, class... ArgTypes> struct is_nothrow_invocable_r;
156
157
    // Alignment properties and transformations:
158
    template <class T> struct alignment_of;
159
    template <size_t Len, size_t Align = most_stringent_alignment_requirement>
160
        struct aligned_storage;
161
    template <size_t Len, class... Types> struct aligned_union;
162
    template <class T> struct remove_cvref; // C++20
163
164
    template <class T> struct decay;
165
    template <class... T> struct common_type;
166
    template <class T> struct underlying_type;
167
    template <class> class result_of; // undefined
168
    template <class Fn, class... ArgTypes> class result_of<Fn(ArgTypes...)>;
169
    template <class Fn, class... ArgTypes> struct invoke_result;  // C++17
170
171
    // const-volatile modifications:
172
    template <class T>
173
      using remove_const_t    = typename remove_const<T>::type;  // C++14
174
    template <class T>
175
      using remove_volatile_t = typename remove_volatile<T>::type;  // C++14
176
    template <class T>
177
      using remove_cv_t       = typename remove_cv<T>::type;  // C++14
178
    template <class T>
179
      using add_const_t       = typename add_const<T>::type;  // C++14
180
    template <class T>
181
      using add_volatile_t    = typename add_volatile<T>::type;  // C++14
182
    template <class T>
183
      using add_cv_t          = typename add_cv<T>::type;  // C++14
184
185
    // reference modifications:
186
    template <class T>
187
      using remove_reference_t     = typename remove_reference<T>::type;  // C++14
188
    template <class T>
189
      using add_lvalue_reference_t = typename add_lvalue_reference<T>::type;  // C++14
190
    template <class T>
191
      using add_rvalue_reference_t = typename add_rvalue_reference<T>::type;  // C++14
192
193
    // sign modifications:
194
    template <class T>
195
      using make_signed_t   = typename make_signed<T>::type;  // C++14
196
    template <class T>
197
      using make_unsigned_t = typename make_unsigned<T>::type;  // C++14
198
199
    // array modifications:
200
    template <class T>
201
      using remove_extent_t      = typename remove_extent<T>::type;  // C++14
202
    template <class T>
203
      using remove_all_extents_t = typename remove_all_extents<T>::type;  // C++14
204
205
    template <class T>
206
      inline constexpr bool is_bounded_array_v
207
        = is_bounded_array<T>::value;                                     // C++20
208
      inline constexpr bool is_unbounded_array_v
209
        = is_unbounded_array<T>::value;                                   // C++20
210
211
    // pointer modifications:
212
    template <class T>
213
      using remove_pointer_t = typename remove_pointer<T>::type;  // C++14
214
    template <class T>
215
      using add_pointer_t    = typename add_pointer<T>::type;  // C++14
216
217
    // other transformations:
218
    template <size_t Len, std::size_t Align=default-alignment>
219
      using aligned_storage_t = typename aligned_storage<Len,Align>::type;  // C++14
220
    template <std::size_t Len, class... Types>
221
      using aligned_union_t   = typename aligned_union<Len,Types...>::type;  // C++14
222
    template <class T>
223
      using remove_cvref_t    = typename remove_cvref<T>::type;  // C++20
224
    template <class T>
225
      using decay_t           = typename decay<T>::type;  // C++14
226
    template <bool b, class T=void>
227
      using enable_if_t       = typename enable_if<b,T>::type;  // C++14
228
    template <bool b, class T, class F>
229
      using conditional_t     = typename conditional<b,T,F>::type;  // C++14
230
    template <class... T>
231
      using common_type_t     = typename common_type<T...>::type;  // C++14
232
    template <class T>
233
      using underlying_type_t = typename underlying_type<T>::type;  // C++14
234
    template <class T>
235
      using result_of_t       = typename result_of<T>::type;  // C++14
236
    template <class Fn, class... ArgTypes>
237
      using invoke_result_t   = typename invoke_result<Fn, ArgTypes...>::type;  // C++17
238
239
    template <class...>
240
      using void_t = void;   // C++17
241
242
      // See C++14 20.10.4.1, primary type categories
243
      template <class T> inline constexpr bool is_void_v
244
        = is_void<T>::value;                                             // C++17
245
      template <class T> inline constexpr bool is_null_pointer_v
246
        = is_null_pointer<T>::value;                                     // C++17
247
      template <class T> inline constexpr bool is_integral_v
248
        = is_integral<T>::value;                                         // C++17
249
      template <class T> inline constexpr bool is_floating_point_v
250
        = is_floating_point<T>::value;                                   // C++17
251
      template <class T> inline constexpr bool is_array_v
252
        = is_array<T>::value;                                            // C++17
253
      template <class T> inline constexpr bool is_pointer_v
254
        = is_pointer<T>::value;                                          // C++17
255
      template <class T> inline constexpr bool is_lvalue_reference_v
256
        = is_lvalue_reference<T>::value;                                 // C++17
257
      template <class T> inline constexpr bool is_rvalue_reference_v
258
        = is_rvalue_reference<T>::value;                                 // C++17
259
      template <class T> inline constexpr bool is_member_object_pointer_v
260
        = is_member_object_pointer<T>::value;                            // C++17
261
      template <class T> inline constexpr bool is_member_function_pointer_v
262
        = is_member_function_pointer<T>::value;                          // C++17
263
      template <class T> inline constexpr bool is_enum_v
264
        = is_enum<T>::value;                                             // C++17
265
      template <class T> inline constexpr bool is_union_v
266
        = is_union<T>::value;                                            // C++17
267
      template <class T> inline constexpr bool is_class_v
268
        = is_class<T>::value;                                            // C++17
269
      template <class T> inline constexpr bool is_function_v
270
        = is_function<T>::value;                                         // C++17
271
272
      // See C++14 20.10.4.2, composite type categories
273
      template <class T> inline constexpr bool is_reference_v
274
        = is_reference<T>::value;                                        // C++17
275
      template <class T> inline constexpr bool is_arithmetic_v
276
        = is_arithmetic<T>::value;                                       // C++17
277
      template <class T> inline constexpr bool is_fundamental_v
278
        = is_fundamental<T>::value;                                      // C++17
279
      template <class T> inline constexpr bool is_object_v
280
        = is_object<T>::value;                                           // C++17
281
      template <class T> inline constexpr bool is_scalar_v
282
        = is_scalar<T>::value;                                           // C++17
283
      template <class T> inline constexpr bool is_compound_v
284
        = is_compound<T>::value;                                         // C++17
285
      template <class T> inline constexpr bool is_member_pointer_v
286
        = is_member_pointer<T>::value;                                   // C++17
287
288
      // See C++14 20.10.4.3, type properties
289
      template <class T> inline constexpr bool is_const_v
290
        = is_const<T>::value;                                            // C++17
291
      template <class T> inline constexpr bool is_volatile_v
292
        = is_volatile<T>::value;                                         // C++17
293
      template <class T> inline constexpr bool is_trivial_v
294
        = is_trivial<T>::value;                                          // C++17
295
      template <class T> inline constexpr bool is_trivially_copyable_v
296
        = is_trivially_copyable<T>::value;                               // C++17
297
      template <class T> inline constexpr bool is_standard_layout_v
298
        = is_standard_layout<T>::value;                                  // C++17
299
      template <class T> inline constexpr bool is_pod_v
300
        = is_pod<T>::value;                                              // C++17
301
      template <class T> inline constexpr bool is_literal_type_v
302
        = is_literal_type<T>::value;                                     // C++17
303
      template <class T> inline constexpr bool is_empty_v
304
        = is_empty<T>::value;                                            // C++17
305
      template <class T> inline constexpr bool is_polymorphic_v
306
        = is_polymorphic<T>::value;                                      // C++17
307
      template <class T> inline constexpr bool is_abstract_v
308
        = is_abstract<T>::value;                                         // C++17
309
      template <class T> inline constexpr bool is_final_v
310
        = is_final<T>::value;                                            // C++17
311
      template <class T> inline constexpr bool is_aggregate_v
312
        = is_aggregate<T>::value;                                        // C++17
313
      template <class T> inline constexpr bool is_signed_v
314
        = is_signed<T>::value;                                           // C++17
315
      template <class T> inline constexpr bool is_unsigned_v
316
        = is_unsigned<T>::value;                                         // C++17
317
      template <class T, class... Args> inline constexpr bool is_constructible_v
318
        = is_constructible<T, Args...>::value;                           // C++17
319
      template <class T> inline constexpr bool is_default_constructible_v
320
        = is_default_constructible<T>::value;                            // C++17
321
      template <class T> inline constexpr bool is_copy_constructible_v
322
        = is_copy_constructible<T>::value;                               // C++17
323
      template <class T> inline constexpr bool is_move_constructible_v
324
        = is_move_constructible<T>::value;                               // C++17
325
      template <class T, class U> inline constexpr bool is_assignable_v
326
        = is_assignable<T, U>::value;                                    // C++17
327
      template <class T> inline constexpr bool is_copy_assignable_v
328
        = is_copy_assignable<T>::value;                                  // C++17
329
      template <class T> inline constexpr bool is_move_assignable_v
330
        = is_move_assignable<T>::value;                                  // C++17
331
      template <class T, class U> inline constexpr bool is_swappable_with_v
332
        = is_swappable_with<T, U>::value;                                // C++17
333
      template <class T> inline constexpr bool is_swappable_v
334
        = is_swappable<T>::value;                                        // C++17
335
      template <class T> inline constexpr bool is_destructible_v
336
        = is_destructible<T>::value;                                     // C++17
337
      template <class T, class... Args> inline constexpr bool is_trivially_constructible_v
338
        = is_trivially_constructible<T, Args...>::value;                 // C++17
339
      template <class T> inline constexpr bool is_trivially_default_constructible_v
340
        = is_trivially_default_constructible<T>::value;                  // C++17
341
      template <class T> inline constexpr bool is_trivially_copy_constructible_v
342
        = is_trivially_copy_constructible<T>::value;                     // C++17
343
      template <class T> inline constexpr bool is_trivially_move_constructible_v
344
        = is_trivially_move_constructible<T>::value;                     // C++17
345
      template <class T, class U> inline constexpr bool is_trivially_assignable_v
346
        = is_trivially_assignable<T, U>::value;                          // C++17
347
      template <class T> inline constexpr bool is_trivially_copy_assignable_v
348
        = is_trivially_copy_assignable<T>::value;                        // C++17
349
      template <class T> inline constexpr bool is_trivially_move_assignable_v
350
        = is_trivially_move_assignable<T>::value;                        // C++17
351
      template <class T> inline constexpr bool is_trivially_destructible_v
352
        = is_trivially_destructible<T>::value;                           // C++17
353
      template <class T, class... Args> inline constexpr bool is_nothrow_constructible_v
354
        = is_nothrow_constructible<T, Args...>::value;                   // C++17
355
      template <class T> inline constexpr bool is_nothrow_default_constructible_v
356
        = is_nothrow_default_constructible<T>::value;                    // C++17
357
      template <class T> inline constexpr bool is_nothrow_copy_constructible_v
358
        = is_nothrow_copy_constructible<T>::value;                       // C++17
359
      template <class T> inline constexpr bool is_nothrow_move_constructible_v
360
        = is_nothrow_move_constructible<T>::value;                       // C++17
361
      template <class T, class U> inline constexpr bool is_nothrow_assignable_v
362
        = is_nothrow_assignable<T, U>::value;                            // C++17
363
      template <class T> inline constexpr bool is_nothrow_copy_assignable_v
364
        = is_nothrow_copy_assignable<T>::value;                          // C++17
365
      template <class T> inline constexpr bool is_nothrow_move_assignable_v
366
        = is_nothrow_move_assignable<T>::value;                          // C++17
367
      template <class T, class U> inline constexpr bool is_nothrow_swappable_with_v
368
        = is_nothrow_swappable_with<T, U>::value;                       // C++17
369
      template <class T> inline constexpr bool is_nothrow_swappable_v
370
        = is_nothrow_swappable<T>::value;                               // C++17
371
      template <class T> inline constexpr bool is_nothrow_destructible_v
372
        = is_nothrow_destructible<T>::value;                             // C++17
373
      template <class T> inline constexpr bool has_virtual_destructor_v
374
        = has_virtual_destructor<T>::value;                              // C++17
375
      template<class T> inline constexpr bool has_unique_object_representations_v // C++17
376
        = has_unique_object_representations<T>::value;
377
378
      // See C++14 20.10.5, type property queries
379
      template <class T> inline constexpr size_t alignment_of_v
380
        = alignment_of<T>::value;                                        // C++17
381
      template <class T> inline constexpr size_t rank_v
382
        = rank<T>::value;                                                // C++17
383
      template <class T, unsigned I = 0> inline constexpr size_t extent_v
384
        = extent<T, I>::value;                                           // C++17
385
386
      // See C++14 20.10.6, type relations
387
      template <class T, class U> inline constexpr bool is_same_v
388
        = is_same<T, U>::value;                                          // C++17
389
      template <class Base, class Derived> inline constexpr bool is_base_of_v
390
        = is_base_of<Base, Derived>::value;                              // C++17
391
      template <class From, class To> inline constexpr bool is_convertible_v
392
        = is_convertible<From, To>::value;                               // C++17
393
      template <class Fn, class... ArgTypes> inline constexpr bool is_invocable_v
394
        = is_invocable<Fn, ArgTypes...>::value;                          // C++17
395
      template <class R, class Fn, class... ArgTypes> inline constexpr bool is_invocable_r_v
396
        = is_invocable_r<R, Fn, ArgTypes...>::value;                     // C++17
397
      template <class Fn, class... ArgTypes> inline constexpr bool is_nothrow_invocable_v
398
        = is_nothrow_invocable<Fn, ArgTypes...>::value;                  // C++17
399
      template <class R, class Fn, class... ArgTypes> inline constexpr bool is_nothrow_invocable_r_v
400
        = is_nothrow_invocable_r<R, Fn, ArgTypes...>::value;             // C++17
401
402
      // [meta.logical], logical operator traits:
403
      template<class... B> struct conjunction;                           // C++17
404
      template<class... B>
405
        inline constexpr bool conjunction_v = conjunction<B...>::value;  // C++17
406
      template<class... B> struct disjunction;                           // C++17
407
      template<class... B>
408
        inline constexpr bool disjunction_v = disjunction<B...>::value;  // C++17
409
      template<class B> struct negation;                                 // C++17
410
      template<class B>
411
        inline constexpr bool negation_v = negation<B>::value;           // C++17
412
413
}
414
415
*/
416
#include <__config>
417
#include <cstddef>
418
#include <version>
419
420
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
421
#pragma GCC system_header
422
#endif
423
424
_LIBCPP_BEGIN_NAMESPACE_STD
425
426
template <class _T1, class _T2> struct _LIBCPP_TEMPLATE_VIS pair;
427
template <class _Tp> class _LIBCPP_TEMPLATE_VIS reference_wrapper;
428
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS hash;
429
430
template <class _Tp, _Tp __v>
431
struct _LIBCPP_TEMPLATE_VIS integral_constant
432
{
433
  static _LIBCPP_CONSTEXPR const _Tp      value = __v;
434
  typedef _Tp               value_type;
435
  typedef integral_constant type;
436
  _LIBCPP_INLINE_VISIBILITY
437
  _LIBCPP_CONSTEXPR operator value_type() const _NOEXCEPT {return value;}
438
#if _LIBCPP_STD_VER > 11
439
  _LIBCPP_INLINE_VISIBILITY
440
  constexpr value_type operator ()() const _NOEXCEPT {return value;}
441
#endif
442
};
443
444
template <class _Tp, _Tp __v>
445
_LIBCPP_CONSTEXPR const _Tp integral_constant<_Tp, __v>::value;
446
447
#if _LIBCPP_STD_VER > 14
448
template <bool __b>
449
using bool_constant = integral_constant<bool, __b>;
450
#define _LIBCPP_BOOL_CONSTANT(__b) bool_constant<(__b)>
451
#else
452
#define _LIBCPP_BOOL_CONSTANT(__b) integral_constant<bool,(__b)>
453
#endif
454
455
typedef _LIBCPP_BOOL_CONSTANT(true)  true_type;
456
typedef _LIBCPP_BOOL_CONSTANT(false) false_type;
457
458
template <bool _Val>
459
using _BoolConstant _LIBCPP_NODEBUG_TYPE = integral_constant<bool, _Val>;
460
461
template <bool> struct _MetaBase;
462
template <>
463
struct _MetaBase<true> {
464
  template <class _Tp, class _Up>
465
  using _SelectImpl _LIBCPP_NODEBUG_TYPE = _Tp;
466
  template <template <class...> class _FirstFn, template <class...> class, class ..._Args>
467
  using _SelectApplyImpl _LIBCPP_NODEBUG_TYPE = _FirstFn<_Args...>;
468
  template <class _First, class...>
469
  using _FirstImpl _LIBCPP_NODEBUG_TYPE = _First;
470
  template <class, class _Second, class...>
471
  using _SecondImpl _LIBCPP_NODEBUG_TYPE = _Second;
472
  template <class _Tp = void>
473
  using _EnableIfImpl _LIBCPP_NODEBUG_TYPE = _Tp;
474
  template <class _Result, class _First, class ..._Rest>
475
  using _OrImpl _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_First::value != true && sizeof...(_Rest) != 0>::template _OrImpl<_First, _Rest...>;
476
  template <class _Result, class _First, class ..._Rest>
477
  using _AndImpl _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_First::value == true && sizeof...(_Rest) != 0>::template _AndImpl<_First, _Rest...>;
478
};
479
480
template <>
481
struct _MetaBase<false> {
482
  template <class _Tp, class _Up>
483
  using _SelectImpl _LIBCPP_NODEBUG_TYPE = _Up;
484
  template <template <class...> class, template <class...> class _SecondFn, class ..._Args>
485
  using _SelectApplyImpl _LIBCPP_NODEBUG_TYPE = _SecondFn<_Args...>;
486
  template <class _Result, class ...>
487
  using _OrImpl _LIBCPP_NODEBUG_TYPE = _Result;
488
  template <class _Result, class ...>
489
  using _AndImpl _LIBCPP_NODEBUG_TYPE = _Result;
490
};
491
template <bool _Cond, class _Ret = void>
492
using _EnableIf _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_Cond>::template _EnableIfImpl<_Ret>;
493
template <bool _Cond, class _IfRes, class _ElseRes>
494
using _If _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_Cond>::template _SelectImpl<_IfRes, _ElseRes>;
495
template <class ..._Rest>
496
using _Or _LIBCPP_NODEBUG_TYPE = typename _MetaBase< sizeof...(_Rest) != 0 >::template _OrImpl<false_type, _Rest...>;
497
template <class ..._Rest>
498
using _And _LIBCPP_NODEBUG_TYPE = typename _MetaBase< sizeof...(_Rest) != 0 >::template _AndImpl<true_type, _Rest...>;
499
template <class _Pred>
500
struct _Not : _BoolConstant<!_Pred::value> {};
501
template <class ..._Args>
502
using _FirstType _LIBCPP_NODEBUG_TYPE = typename _MetaBase<(sizeof...(_Args) >= 1)>::template _FirstImpl<_Args...>;
503
template <class ..._Args>
504
using _SecondType _LIBCPP_NODEBUG_TYPE = typename _MetaBase<(sizeof...(_Args) >= 2)>::template _SecondImpl<_Args...>;
505
506
template <template <class...> class _Func, class ..._Args>
507
struct _Lazy : _Func<_Args...> {};
508
509
// Member detector base
510
511
template <template <class...> class _Templ, class ..._Args, class = _Templ<_Args...> >
512
true_type __sfinae_test_impl(int);
513
template <template <class...> class, class ...>
514
false_type __sfinae_test_impl(...);
515
516
template <template <class ...> class _Templ, class ..._Args>
517
using _IsValidExpansion _LIBCPP_NODEBUG_TYPE = decltype(std::__sfinae_test_impl<_Templ, _Args...>(0));
518
519
template <class>
520
struct __void_t { typedef void type; };
521
522
template <class _Tp>
523
struct __identity { typedef _Tp type; };
524
525
template <class _Tp, bool>
526
struct _LIBCPP_TEMPLATE_VIS __dependent_type : public _Tp {};
527
528
529
template <bool _Bp, class _If, class _Then>
530
    struct _LIBCPP_TEMPLATE_VIS conditional {typedef _If type;};
531
template <class _If, class _Then>
532
    struct _LIBCPP_TEMPLATE_VIS conditional<false, _If, _Then> {typedef _Then type;};
533
534
#if _LIBCPP_STD_VER > 11
535
template <bool _Bp, class _If, class _Then> using conditional_t = typename conditional<_Bp, _If, _Then>::type;
536
#endif
537
538
template <bool, class _Tp = void> struct _LIBCPP_TEMPLATE_VIS enable_if {};
539
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS enable_if<true, _Tp> {typedef _Tp type;};
540
541
#if _LIBCPP_STD_VER > 11
542
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
543
#endif
544
545
// is_same
546
547
template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS is_same           : public false_type {};
548
template <class _Tp>            struct _LIBCPP_TEMPLATE_VIS is_same<_Tp, _Tp> : public true_type {};
549
550
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
551
template <class _Tp, class _Up>
552
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_same_v
553
    = is_same<_Tp, _Up>::value;
554
#endif
555
556
template <class _Tp, class _Up>
557
using _IsSame = _BoolConstant<
558
#ifdef __clang__
559
    __is_same(_Tp, _Up)
560
#else
561
    _VSTD::is_same<_Tp, _Up>::value
562
#endif
563
>;
564
565
template <class _Tp, class _Up>
566
using _IsNotSame = _BoolConstant<
567
#ifdef __clang__
568
    !__is_same(_Tp, _Up)
569
#else
570
    !_VSTD::is_same<_Tp, _Up>::value
571
#endif
572
>;
573
574
575
template <class _Tp>
576
using __test_for_primary_template = _EnableIf<
577
    _IsSame<_Tp, typename _Tp::__primary_template>::value
578
  >;
579
template <class _Tp>
580
using __is_primary_template = _IsValidExpansion<
581
    __test_for_primary_template, _Tp
582
  >;
583
584
// addressof
585
#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
586
587
template <class _Tp>
588
inline _LIBCPP_CONSTEXPR_AFTER_CXX14
589
_LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
590
_Tp*
591
addressof(_Tp& __x) _NOEXCEPT
592
2.71G
{
593
2.71G
    return __builtin_addressof(__x);
594
2.71G
}
char* std::__1::addressof<char>(char&)
Line
Count
Source
592
388M
{
593
388M
    return __builtin_addressof(__x);
594
388M
}
wchar_t* std::__1::addressof<wchar_t>(wchar_t&)
Line
Count
Source
592
9
{
593
9
    return __builtin_addressof(__x);
594
9
}
Unexecuted instantiation: char16_t* std::__1::addressof<char16_t>(char16_t&)
Unexecuted instantiation: char32_t* std::__1::addressof<char32_t>(char32_t&)
Unexecuted instantiation: std::__1::__shared_ptr_emplace<std::__1::mutex, std::__1::allocator<std::__1::mutex> >* std::__1::addressof<std::__1::__shared_ptr_emplace<std::__1::mutex, std::__1::allocator<std::__1::mutex> > >(std::__1::__shared_ptr_emplace<std::__1::mutex, std::__1::allocator<std::__1::mutex> >&)
std::__1::mutex* std::__1::addressof<std::__1::mutex>(std::__1::mutex&)
Line
Count
Source
592
1.56M
{
593
1.56M
    return __builtin_addressof(__x);
594
1.56M
}
char const* std::__1::addressof<char const>(char const&)
Line
Count
Source
592
2.31G
{
593
2.31G
    return __builtin_addressof(__x);
594
2.31G
}
wchar_t const* std::__1::addressof<wchar_t const>(wchar_t const&)
Line
Count
Source
592
68
{
593
68
    return __builtin_addressof(__x);
594
68
}
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* std::__1::addressof<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)
Line
Count
Source
592
14.4M
{
593
14.4M
    return __builtin_addressof(__x);
594
14.4M
}
Unexecuted instantiation: std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >* std::__1::addressof<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > >(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&)
Unexecuted instantiation: std::__1::pair<std::__1::condition_variable*, std::__1::mutex*>* std::__1::addressof<std::__1::pair<std::__1::condition_variable*, std::__1::mutex*> >(std::__1::pair<std::__1::condition_variable*, std::__1::mutex*>&)
Unexecuted instantiation: std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::filesystem_error::_Storage, std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage> >* std::__1::addressof<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::filesystem_error::_Storage, std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage> > >(std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::filesystem_error::_Storage, std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage> >&)
Unexecuted instantiation: std::__1::__fs::filesystem::filesystem_error::_Storage* std::__1::addressof<std::__1::__fs::filesystem::filesystem_error::_Storage>(std::__1::__fs::filesystem::filesystem_error::_Storage&)
Unexecuted instantiation: std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> >* std::__1::addressof<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> > >(std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> >&)
Unexecuted instantiation: std::__1::basic_string<char32_t, std::__1::char_traits<char32_t>, std::__1::allocator<char32_t> >* std::__1::addressof<std::__1::basic_string<char32_t, std::__1::char_traits<char32_t>, std::__1::allocator<char32_t> > >(std::__1::basic_string<char32_t, std::__1::char_traits<char32_t>, std::__1::allocator<char32_t> >&)
Unexecuted instantiation: std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::__dir_stream, std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> >* std::__1::addressof<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::__dir_stream, std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> > >(std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::__dir_stream, std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> >&)
Unexecuted instantiation: std::__1::__fs::filesystem::__dir_stream* std::__1::addressof<std::__1::__fs::filesystem::__dir_stream>(std::__1::__fs::filesystem::__dir_stream&)
Unexecuted instantiation: std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp, std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp> >* std::__1::addressof<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp, std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp> > >(std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp, std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp> >&)
Unexecuted instantiation: std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp* std::__1::addressof<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp>(std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp&)
595
596
#else
597
598
template <class _Tp>
599
inline _LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
600
_Tp*
601
addressof(_Tp& __x) _NOEXCEPT
602
{
603
  return reinterpret_cast<_Tp *>(
604
      const_cast<char *>(&reinterpret_cast<const volatile char &>(__x)));
605
}
606
607
#endif // _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
608
609
#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
610
// Objective-C++ Automatic Reference Counting uses qualified pointers
611
// that require special addressof() signatures. When
612
// _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler
613
// itself is providing these definitions. Otherwise, we provide them.
614
template <class _Tp>
615
inline _LIBCPP_INLINE_VISIBILITY
616
__strong _Tp*
617
addressof(__strong _Tp& __x) _NOEXCEPT
618
{
619
  return &__x;
620
}
621
622
#ifdef _LIBCPP_HAS_OBJC_ARC_WEAK
623
template <class _Tp>
624
inline _LIBCPP_INLINE_VISIBILITY
625
__weak _Tp*
626
addressof(__weak _Tp& __x) _NOEXCEPT
627
{
628
  return &__x;
629
}
630
#endif
631
632
template <class _Tp>
633
inline _LIBCPP_INLINE_VISIBILITY
634
__autoreleasing _Tp*
635
addressof(__autoreleasing _Tp& __x) _NOEXCEPT
636
{
637
  return &__x;
638
}
639
640
template <class _Tp>
641
inline _LIBCPP_INLINE_VISIBILITY
642
__unsafe_unretained _Tp*
643
addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
644
{
645
  return &__x;
646
}
647
#endif
648
649
#if !defined(_LIBCPP_CXX03_LANG)
650
template <class _Tp> _Tp* addressof(const _Tp&&) noexcept = delete;
651
#endif
652
653
struct __two {char __lx[2];};
654
655
// helper class:
656
657
// is_const
658
659
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_const            : public false_type {};
660
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_const<_Tp const> : public true_type {};
661
662
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
663
template <class _Tp>
664
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_const_v
665
    = is_const<_Tp>::value;
666
#endif
667
668
// is_volatile
669
670
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_volatile               : public false_type {};
671
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_volatile<_Tp volatile> : public true_type {};
672
673
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
674
template <class _Tp>
675
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_volatile_v
676
    = is_volatile<_Tp>::value;
677
#endif
678
679
// remove_const
680
681
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_const            {typedef _Tp type;};
682
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_const<const _Tp> {typedef _Tp type;};
683
#if _LIBCPP_STD_VER > 11
684
template <class _Tp> using remove_const_t = typename remove_const<_Tp>::type;
685
#endif
686
687
// remove_volatile
688
689
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_volatile               {typedef _Tp type;};
690
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_volatile<volatile _Tp> {typedef _Tp type;};
691
#if _LIBCPP_STD_VER > 11
692
template <class _Tp> using remove_volatile_t = typename remove_volatile<_Tp>::type;
693
#endif
694
695
// remove_cv
696
697
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
698
{typedef typename remove_volatile<typename remove_const<_Tp>::type>::type type;};
699
#if _LIBCPP_STD_VER > 11
700
template <class _Tp> using remove_cv_t = typename remove_cv<_Tp>::type;
701
#endif
702
703
// is_void
704
705
template <class _Tp> struct __libcpp_is_void       : public false_type {};
706
template <>          struct __libcpp_is_void<void> : public true_type {};
707
708
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_void
709
    : public __libcpp_is_void<typename remove_cv<_Tp>::type> {};
710
711
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
712
template <class _Tp>
713
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_void_v
714
    = is_void<_Tp>::value;
715
#endif
716
717
// __is_nullptr_t
718
719
template <class _Tp> struct __is_nullptr_t_impl       : public false_type {};
720
template <>          struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
721
722
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS __is_nullptr_t
723
    : public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {};
724
725
#if _LIBCPP_STD_VER > 11
726
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_null_pointer
727
    : public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {};
728
729
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
730
template <class _Tp>
731
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_null_pointer_v
732
    = is_null_pointer<_Tp>::value;
733
#endif
734
#endif // _LIBCPP_STD_VER > 11
735
736
// is_integral
737
738
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_integral
739
    : public _BoolConstant<__libcpp_is_integral<typename remove_cv<_Tp>::type>::value> {};
740
741
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
742
template <class _Tp>
743
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_integral_v
744
    = is_integral<_Tp>::value;
745
#endif
746
747
// is_floating_point
748
749
template <class _Tp> struct __libcpp_is_floating_point              : public false_type {};
750
template <>          struct __libcpp_is_floating_point<float>       : public true_type {};
751
template <>          struct __libcpp_is_floating_point<double>      : public true_type {};
752
template <>          struct __libcpp_is_floating_point<long double> : public true_type {};
753
754
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_floating_point
755
    : public __libcpp_is_floating_point<typename remove_cv<_Tp>::type> {};
756
757
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
758
template <class _Tp>
759
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_floating_point_v
760
    = is_floating_point<_Tp>::value;
761
#endif
762
763
// is_array
764
765
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_array
766
    : public false_type {};
767
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_array<_Tp[]>
768
    : public true_type {};
769
template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS is_array<_Tp[_Np]>
770
    : public true_type {};
771
772
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
773
template <class _Tp>
774
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_array_v
775
    = is_array<_Tp>::value;
776
#endif
777
778
// is_pointer
779
780
template <class _Tp> struct __libcpp_is_pointer       : public false_type {};
781
template <class _Tp> struct __libcpp_is_pointer<_Tp*> : public true_type {};
782
783
template <class _Tp> struct __libcpp_remove_objc_qualifiers { typedef _Tp type; };
784
#if defined(_LIBCPP_HAS_OBJC_ARC)
785
template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __strong> { typedef _Tp type; };
786
template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __weak> { typedef _Tp type; };
787
template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __autoreleasing> { typedef _Tp type; };
788
template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __unsafe_unretained> { typedef _Tp type; };
789
#endif
790
791
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pointer
792
    : public __libcpp_is_pointer<typename __libcpp_remove_objc_qualifiers<typename remove_cv<_Tp>::type>::type> {};
793
794
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
795
template <class _Tp>
796
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_pointer_v
797
    = is_pointer<_Tp>::value;
798
#endif
799
800
// is_reference
801
802
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference       : public false_type {};
803
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference<_Tp&> : public true_type {};
804
805
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference        : public false_type {};
806
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference<_Tp&&> : public true_type {};
807
808
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference        : public false_type {};
809
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&>  : public true_type {};
810
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&&> : public true_type {};
811
812
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
813
template <class _Tp>
814
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_reference_v
815
    = is_reference<_Tp>::value;
816
817
template <class _Tp>
818
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_lvalue_reference_v
819
    = is_lvalue_reference<_Tp>::value;
820
821
template <class _Tp>
822
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_rvalue_reference_v
823
    = is_rvalue_reference<_Tp>::value;
824
#endif
825
// is_union
826
827
#if __has_feature(is_union) || defined(_LIBCPP_COMPILER_GCC)
828
829
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_union
830
    : public integral_constant<bool, __is_union(_Tp)> {};
831
832
#else
833
834
template <class _Tp> struct __libcpp_union : public false_type {};
835
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_union
836
    : public __libcpp_union<typename remove_cv<_Tp>::type> {};
837
838
#endif
839
840
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
841
template <class _Tp>
842
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_union_v
843
    = is_union<_Tp>::value;
844
#endif
845
846
// is_class
847
848
#if __has_feature(is_class) || defined(_LIBCPP_COMPILER_GCC)
849
850
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_class
851
    : public integral_constant<bool, __is_class(_Tp)> {};
852
853
#else
854
855
namespace __is_class_imp
856
{
857
template <class _Tp> char  __test(int _Tp::*);
858
template <class _Tp> __two __test(...);
859
}
860
861
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_class
862
    : public integral_constant<bool, sizeof(__is_class_imp::__test<_Tp>(0)) == 1 && !is_union<_Tp>::value> {};
863
864
#endif
865
866
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
867
template <class _Tp>
868
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_class_v
869
    = is_class<_Tp>::value;
870
#endif
871
872
// is_function
873
874
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_function
875
    : public _BoolConstant<
876
#ifdef __clang__
877
    __is_function(_Tp)
878
#else
879
 !(is_reference<_Tp>::value || is_const<const _Tp>::value)
880
#endif
881
    > {};
882
883
884
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
885
template <class _Tp>
886
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_function_v
887
    = is_function<_Tp>::value;
888
#endif
889
890
template <class _Tp> struct __libcpp_is_member_pointer {
891
  enum {
892
    __is_member = false,
893
    __is_func = false,
894
    __is_obj = false
895
  };
896
};
897
template <class _Tp, class _Up> struct __libcpp_is_member_pointer<_Tp _Up::*> {
898
  enum {
899
    __is_member = true,
900
    __is_func = is_function<_Tp>::value,
901
    __is_obj = !__is_func,
902
  };
903
};
904
905
906
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer
907
    : public _BoolConstant< __libcpp_is_member_pointer<typename remove_cv<_Tp>::type>::__is_func > {};
908
909
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
910
template <class _Tp>
911
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_member_function_pointer_v
912
    = is_member_function_pointer<_Tp>::value;
913
#endif
914
915
// is_member_pointer
916
917
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_pointer
918
 : public _BoolConstant< __libcpp_is_member_pointer<typename remove_cv<_Tp>::type>::__is_member > {};
919
920
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
921
template <class _Tp>
922
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_member_pointer_v
923
    = is_member_pointer<_Tp>::value;
924
#endif
925
926
// is_member_object_pointer
927
928
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer
929
    : public _BoolConstant< __libcpp_is_member_pointer<typename remove_cv<_Tp>::type>::__is_obj >  {};
930
931
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
932
template <class _Tp>
933
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_member_object_pointer_v
934
    = is_member_object_pointer<_Tp>::value;
935
#endif
936
937
// is_enum
938
939
#if __has_feature(is_enum) || defined(_LIBCPP_COMPILER_GCC)
940
941
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_enum
942
    : public integral_constant<bool, __is_enum(_Tp)> {};
943
944
#else
945
946
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_enum
947
    : public integral_constant<bool, !is_void<_Tp>::value             &&
948
                                     !is_integral<_Tp>::value         &&
949
                                     !is_floating_point<_Tp>::value   &&
950
                                     !is_array<_Tp>::value            &&
951
                                     !is_pointer<_Tp>::value          &&
952
                                     !is_reference<_Tp>::value        &&
953
                                     !is_member_pointer<_Tp>::value   &&
954
                                     !is_union<_Tp>::value            &&
955
                                     !is_class<_Tp>::value            &&
956
                                     !is_function<_Tp>::value         > {};
957
958
#endif
959
960
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
961
template <class _Tp>
962
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_enum_v
963
    = is_enum<_Tp>::value;
964
#endif
965
966
// is_arithmetic
967
968
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_arithmetic
969
    : public integral_constant<bool, is_integral<_Tp>::value      ||
970
                                     is_floating_point<_Tp>::value> {};
971
972
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
973
template <class _Tp>
974
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_arithmetic_v
975
    = is_arithmetic<_Tp>::value;
976
#endif
977
978
// is_fundamental
979
980
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_fundamental
981
    : public integral_constant<bool, is_void<_Tp>::value        ||
982
                                     __is_nullptr_t<_Tp>::value ||
983
                                     is_arithmetic<_Tp>::value> {};
984
985
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
986
template <class _Tp>
987
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_fundamental_v
988
    = is_fundamental<_Tp>::value;
989
#endif
990
991
// is_scalar
992
993
template <class _Tp> struct __is_block : false_type {};
994
#if defined(_LIBCPP_HAS_EXTENSION_BLOCKS)
995
template <class _Rp, class ..._Args> struct __is_block<_Rp (^)(_Args...)> : true_type {};
996
#endif
997
998
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_scalar
999
    : public integral_constant<bool, is_arithmetic<_Tp>::value     ||
1000
                                     is_member_pointer<_Tp>::value ||
1001
                                     is_pointer<_Tp>::value        ||
1002
                                     __is_nullptr_t<_Tp>::value    ||
1003
                                     __is_block<_Tp>::value        ||
1004
                                     is_enum<_Tp>::value           > {};
1005
1006
template <> struct _LIBCPP_TEMPLATE_VIS is_scalar<nullptr_t> : public true_type {};
1007
1008
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1009
template <class _Tp>
1010
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_scalar_v
1011
    = is_scalar<_Tp>::value;
1012
#endif
1013
1014
// is_object
1015
1016
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_object
1017
    : public integral_constant<bool, is_scalar<_Tp>::value ||
1018
                                     is_array<_Tp>::value  ||
1019
                                     is_union<_Tp>::value  ||
1020
                                     is_class<_Tp>::value  > {};
1021
1022
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1023
template <class _Tp>
1024
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_object_v
1025
    = is_object<_Tp>::value;
1026
#endif
1027
1028
// is_compound
1029
1030
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_compound
1031
    : public integral_constant<bool, !is_fundamental<_Tp>::value> {};
1032
1033
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1034
template <class _Tp>
1035
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_compound_v
1036
    = is_compound<_Tp>::value;
1037
#endif
1038
1039
1040
// __is_referenceable  [defns.referenceable]
1041
1042
struct __is_referenceable_impl {
1043
    template <class _Tp> static _Tp& __test(int);
1044
    template <class _Tp> static __two __test(...);
1045
};
1046
1047
template <class _Tp>
1048
struct __is_referenceable : integral_constant<bool,
1049
    _IsNotSame<decltype(__is_referenceable_impl::__test<_Tp>(0)), __two>::value> {};
1050
1051
1052
// add_const
1053
1054
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_const {
1055
  typedef _LIBCPP_NODEBUG_TYPE const _Tp type;
1056
};
1057
1058
#if _LIBCPP_STD_VER > 11
1059
template <class _Tp> using add_const_t = typename add_const<_Tp>::type;
1060
#endif
1061
1062
// add_volatile
1063
1064
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_volatile {
1065
  typedef _LIBCPP_NODEBUG_TYPE volatile _Tp type;
1066
};
1067
1068
#if _LIBCPP_STD_VER > 11
1069
template <class _Tp> using add_volatile_t = typename add_volatile<_Tp>::type;
1070
#endif
1071
1072
// add_cv
1073
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_cv {
1074
  typedef _LIBCPP_NODEBUG_TYPE const volatile _Tp type;
1075
};
1076
1077
#if _LIBCPP_STD_VER > 11
1078
template <class _Tp> using add_cv_t = typename add_cv<_Tp>::type;
1079
#endif
1080
1081
// remove_reference
1082
1083
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference        {typedef _LIBCPP_NODEBUG_TYPE _Tp type;};
1084
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&>  {typedef _LIBCPP_NODEBUG_TYPE _Tp type;};
1085
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _LIBCPP_NODEBUG_TYPE _Tp type;};
1086
1087
#if _LIBCPP_STD_VER > 11
1088
template <class _Tp> using remove_reference_t = typename remove_reference<_Tp>::type;
1089
#endif
1090
1091
// add_lvalue_reference
1092
1093
template <class _Tp, bool = __is_referenceable<_Tp>::value> struct __add_lvalue_reference_impl            { typedef _LIBCPP_NODEBUG_TYPE _Tp  type; };
1094
template <class _Tp                                       > struct __add_lvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG_TYPE _Tp& type; };
1095
1096
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_lvalue_reference
1097
{typedef _LIBCPP_NODEBUG_TYPE typename  __add_lvalue_reference_impl<_Tp>::type type;};
1098
1099
#if _LIBCPP_STD_VER > 11
1100
template <class _Tp> using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type;
1101
#endif
1102
1103
template <class _Tp, bool = __is_referenceable<_Tp>::value> struct __add_rvalue_reference_impl            { typedef _LIBCPP_NODEBUG_TYPE  _Tp   type; };
1104
template <class _Tp                                       > struct __add_rvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG_TYPE  _Tp&& type; };
1105
1106
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_rvalue_reference
1107
{typedef _LIBCPP_NODEBUG_TYPE  typename __add_rvalue_reference_impl<_Tp>::type type;};
1108
1109
#if _LIBCPP_STD_VER > 11
1110
template <class _Tp> using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type;
1111
#endif
1112
1113
// Suppress deprecation notice for volatile-qualified return type resulting
1114
// from volatile-qualified types _Tp.
1115
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
1116
template <class _Tp> _Tp&& __declval(int);
1117
template <class _Tp> _Tp   __declval(long);
1118
_LIBCPP_SUPPRESS_DEPRECATED_POP
1119
1120
template <class _Tp>
1121
decltype(_VSTD::__declval<_Tp>(0))
1122
declval() _NOEXCEPT;
1123
1124
// __uncvref
1125
1126
template <class _Tp>
1127
struct __uncvref  {
1128
    typedef _LIBCPP_NODEBUG_TYPE typename remove_cv<typename remove_reference<_Tp>::type>::type type;
1129
};
1130
1131
template <class _Tp>
1132
struct __unconstref {
1133
    typedef _LIBCPP_NODEBUG_TYPE typename remove_const<typename remove_reference<_Tp>::type>::type type;
1134
};
1135
1136
#ifndef _LIBCPP_CXX03_LANG
1137
template <class _Tp>
1138
using __uncvref_t _LIBCPP_NODEBUG_TYPE = typename __uncvref<_Tp>::type;
1139
#endif
1140
1141
// __is_same_uncvref
1142
1143
template <class _Tp, class _Up>
1144
struct __is_same_uncvref : _IsSame<typename __uncvref<_Tp>::type,
1145
                                   typename __uncvref<_Up>::type> {};
1146
1147
#if _LIBCPP_STD_VER > 17
1148
// remove_cvref - same as __uncvref
1149
template <class _Tp>
1150
struct remove_cvref : public __uncvref<_Tp> {};
1151
1152
template <class _Tp> using remove_cvref_t = typename remove_cvref<_Tp>::type;
1153
#endif
1154
1155
1156
struct __any
1157
{
1158
    __any(...);
1159
};
1160
1161
// remove_pointer
1162
1163
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer                      {typedef _LIBCPP_NODEBUG_TYPE _Tp type;};
1164
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp*>                {typedef _LIBCPP_NODEBUG_TYPE _Tp type;};
1165
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const>          {typedef _LIBCPP_NODEBUG_TYPE _Tp type;};
1166
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* volatile>       {typedef _LIBCPP_NODEBUG_TYPE _Tp type;};
1167
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const volatile> {typedef _LIBCPP_NODEBUG_TYPE _Tp type;};
1168
1169
#if _LIBCPP_STD_VER > 11
1170
template <class _Tp> using remove_pointer_t = typename remove_pointer<_Tp>::type;
1171
#endif
1172
1173
// add_pointer
1174
1175
template <class _Tp,
1176
        bool = __is_referenceable<_Tp>::value ||
1177
                _IsSame<typename remove_cv<_Tp>::type, void>::value>
1178
struct __add_pointer_impl
1179
    {typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type* type;};
1180
template <class _Tp> struct __add_pointer_impl<_Tp, false>
1181
    {typedef _LIBCPP_NODEBUG_TYPE _Tp type;};
1182
1183
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_pointer
1184
    {typedef _LIBCPP_NODEBUG_TYPE typename __add_pointer_impl<_Tp>::type type;};
1185
1186
#if _LIBCPP_STD_VER > 11
1187
template <class _Tp> using add_pointer_t = typename add_pointer<_Tp>::type;
1188
#endif
1189
1190
// type_identity
1191
#if _LIBCPP_STD_VER > 17
1192
template<class _Tp> struct type_identity { typedef _Tp type; };
1193
template<class _Tp> using type_identity_t = typename type_identity<_Tp>::type;
1194
#endif
1195
1196
// is_signed
1197
1198
template <class _Tp, bool = is_integral<_Tp>::value>
1199
struct __libcpp_is_signed_impl : public _LIBCPP_BOOL_CONSTANT(_Tp(-1) < _Tp(0)) {};
1200
1201
template <class _Tp>
1202
struct __libcpp_is_signed_impl<_Tp, false> : public true_type {};  // floating point
1203
1204
template <class _Tp, bool = is_arithmetic<_Tp>::value>
1205
struct __libcpp_is_signed : public __libcpp_is_signed_impl<_Tp> {};
1206
1207
template <class _Tp> struct __libcpp_is_signed<_Tp, false> : public false_type {};
1208
1209
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_signed : public __libcpp_is_signed<_Tp> {};
1210
1211
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1212
template <class _Tp>
1213
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_signed_v
1214
    = is_signed<_Tp>::value;
1215
#endif
1216
1217
// is_unsigned
1218
1219
template <class _Tp, bool = is_integral<_Tp>::value>
1220
struct __libcpp_is_unsigned_impl : public _LIBCPP_BOOL_CONSTANT(_Tp(0) < _Tp(-1)) {};
1221
1222
template <class _Tp>
1223
struct __libcpp_is_unsigned_impl<_Tp, false> : public false_type {};  // floating point
1224
1225
template <class _Tp, bool = is_arithmetic<_Tp>::value>
1226
struct __libcpp_is_unsigned : public __libcpp_is_unsigned_impl<_Tp> {};
1227
1228
template <class _Tp> struct __libcpp_is_unsigned<_Tp, false> : public false_type {};
1229
1230
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_unsigned : public __libcpp_is_unsigned<_Tp> {};
1231
1232
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1233
template <class _Tp>
1234
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_unsigned_v
1235
    = is_unsigned<_Tp>::value;
1236
#endif
1237
1238
// rank
1239
1240
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS rank
1241
    : public integral_constant<size_t, 0> {};
1242
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS rank<_Tp[]>
1243
    : public integral_constant<size_t, rank<_Tp>::value + 1> {};
1244
template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS rank<_Tp[_Np]>
1245
    : public integral_constant<size_t, rank<_Tp>::value + 1> {};
1246
1247
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1248
template <class _Tp>
1249
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR size_t rank_v
1250
    = rank<_Tp>::value;
1251
#endif
1252
1253
// extent
1254
1255
template <class _Tp, unsigned _Ip = 0> struct _LIBCPP_TEMPLATE_VIS extent
1256
    : public integral_constant<size_t, 0> {};
1257
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[], 0>
1258
    : public integral_constant<size_t, 0> {};
1259
template <class _Tp, unsigned _Ip> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[], _Ip>
1260
    : public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
1261
template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[_Np], 0>
1262
    : public integral_constant<size_t, _Np> {};
1263
template <class _Tp, size_t _Np, unsigned _Ip> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[_Np], _Ip>
1264
    : public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
1265
1266
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1267
template <class _Tp, unsigned _Ip = 0>
1268
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR size_t extent_v
1269
    = extent<_Tp, _Ip>::value;
1270
#endif
1271
1272
// remove_extent
1273
1274
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_extent
1275
    {typedef _Tp type;};
1276
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[]>
1277
    {typedef _Tp type;};
1278
template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[_Np]>
1279
    {typedef _Tp type;};
1280
1281
#if _LIBCPP_STD_VER > 11
1282
template <class _Tp> using remove_extent_t = typename remove_extent<_Tp>::type;
1283
#endif
1284
1285
// remove_all_extents
1286
1287
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_all_extents
1288
    {typedef _Tp type;};
1289
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[]>
1290
    {typedef typename remove_all_extents<_Tp>::type type;};
1291
template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[_Np]>
1292
    {typedef typename remove_all_extents<_Tp>::type type;};
1293
1294
#if _LIBCPP_STD_VER > 11
1295
template <class _Tp> using remove_all_extents_t = typename remove_all_extents<_Tp>::type;
1296
#endif
1297
1298
#if _LIBCPP_STD_VER > 17
1299
// is_bounded_array
1300
1301
template <class>                 struct _LIBCPP_TEMPLATE_VIS is_bounded_array           : false_type {};
1302
template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS is_bounded_array<_Tp[_Np]> : true_type {};
1303
1304
template <class _Tp>
1305
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR
1306
bool is_bounded_array_v  = is_bounded_array<_Tp>::value;
1307
1308
// is_unbounded_array
1309
1310
template <class>     struct _LIBCPP_TEMPLATE_VIS is_unbounded_array        : false_type {};
1311
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_unbounded_array<_Tp[]> : true_type {};
1312
1313
template <class _Tp>
1314
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR
1315
bool is_unbounded_array_v  = is_unbounded_array<_Tp>::value;
1316
#endif
1317
1318
// decay
1319
1320
template <class _Up, bool>
1321
struct __decay {
1322
    typedef _LIBCPP_NODEBUG_TYPE typename remove_cv<_Up>::type type;
1323
};
1324
1325
template <class _Up>
1326
struct __decay<_Up, true> {
1327
public:
1328
    typedef _LIBCPP_NODEBUG_TYPE typename conditional
1329
                     <
1330
                         is_array<_Up>::value,
1331
                         typename remove_extent<_Up>::type*,
1332
                         typename conditional
1333
                         <
1334
                              is_function<_Up>::value,
1335
                              typename add_pointer<_Up>::type,
1336
                              typename remove_cv<_Up>::type
1337
                         >::type
1338
                     >::type type;
1339
};
1340
1341
template <class _Tp>
1342
struct _LIBCPP_TEMPLATE_VIS decay
1343
{
1344
private:
1345
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
1346
public:
1347
    typedef _LIBCPP_NODEBUG_TYPE typename __decay<_Up, __is_referenceable<_Up>::value>::type type;
1348
};
1349
1350
#if _LIBCPP_STD_VER > 11
1351
template <class _Tp> using decay_t = typename decay<_Tp>::type;
1352
#endif
1353
1354
// is_abstract
1355
1356
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_abstract
1357
    : public integral_constant<bool, __is_abstract(_Tp)> {};
1358
1359
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1360
template <class _Tp>
1361
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_abstract_v
1362
    = is_abstract<_Tp>::value;
1363
#endif
1364
1365
// is_final
1366
1367
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
1368
__libcpp_is_final : public integral_constant<bool, __is_final(_Tp)> {};
1369
1370
#if _LIBCPP_STD_VER > 11
1371
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
1372
is_final : public integral_constant<bool, __is_final(_Tp)> {};
1373
#endif
1374
1375
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1376
template <class _Tp>
1377
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_final_v
1378
    = is_final<_Tp>::value;
1379
#endif
1380
1381
// is_aggregate
1382
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_IS_AGGREGATE)
1383
1384
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
1385
is_aggregate : public integral_constant<bool, __is_aggregate(_Tp)> {};
1386
1387
#if !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1388
template <class _Tp>
1389
_LIBCPP_INLINE_VAR constexpr bool is_aggregate_v
1390
    = is_aggregate<_Tp>::value;
1391
#endif
1392
1393
#endif // _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_IS_AGGREGATE)
1394
1395
// is_base_of
1396
1397
template <class _Bp, class _Dp>
1398
struct _LIBCPP_TEMPLATE_VIS is_base_of
1399
    : public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
1400
1401
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1402
template <class _Bp, class _Dp>
1403
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_base_of_v
1404
    = is_base_of<_Bp, _Dp>::value;
1405
#endif
1406
1407
// is_convertible
1408
1409
#if __has_feature(is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
1410
1411
template <class _T1, class _T2> struct _LIBCPP_TEMPLATE_VIS is_convertible
1412
    : public integral_constant<bool, __is_convertible_to(_T1, _T2)> {};
1413
1414
#else  // __has_feature(is_convertible_to)
1415
1416
namespace __is_convertible_imp
1417
{
1418
template <class _Tp> void  __test_convert(_Tp);
1419
1420
template <class _From, class _To, class = void>
1421
struct __is_convertible_test : public false_type {};
1422
1423
template <class _From, class _To>
1424
struct __is_convertible_test<_From, _To,
1425
    decltype(_VSTD::__is_convertible_imp::__test_convert<_To>(_VSTD::declval<_From>()))> : public true_type
1426
{};
1427
1428
template <class _Tp, bool _IsArray =    is_array<_Tp>::value,
1429
                     bool _IsFunction = is_function<_Tp>::value,
1430
                     bool _IsVoid =     is_void<_Tp>::value>
1431
                     struct __is_array_function_or_void                          {enum {value = 0};};
1432
template <class _Tp> struct __is_array_function_or_void<_Tp, true, false, false> {enum {value = 1};};
1433
template <class _Tp> struct __is_array_function_or_void<_Tp, false, true, false> {enum {value = 2};};
1434
template <class _Tp> struct __is_array_function_or_void<_Tp, false, false, true> {enum {value = 3};};
1435
}
1436
1437
template <class _Tp,
1438
    unsigned = __is_convertible_imp::__is_array_function_or_void<typename remove_reference<_Tp>::type>::value>
1439
struct __is_convertible_check
1440
{
1441
    static const size_t __v = 0;
1442
};
1443
1444
template <class _Tp>
1445
struct __is_convertible_check<_Tp, 0>
1446
{
1447
    static const size_t __v = sizeof(_Tp);
1448
};
1449
1450
template <class _T1, class _T2,
1451
    unsigned _T1_is_array_function_or_void = __is_convertible_imp::__is_array_function_or_void<_T1>::value,
1452
    unsigned _T2_is_array_function_or_void = __is_convertible_imp::__is_array_function_or_void<_T2>::value>
1453
struct __is_convertible
1454
    : public integral_constant<bool,
1455
        __is_convertible_imp::__is_convertible_test<_T1, _T2>::value
1456
    >
1457
{};
1458
1459
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 0, 1> : public false_type {};
1460
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 1> : public false_type {};
1461
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 1> : public false_type {};
1462
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 1> : public false_type {};
1463
1464
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 0, 2> : public false_type {};
1465
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 2> : public false_type {};
1466
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 2> : public false_type {};
1467
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 2> : public false_type {};
1468
1469
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 0, 3> : public false_type {};
1470
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 3> : public false_type {};
1471
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 3> : public false_type {};
1472
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 3> : public true_type {};
1473
1474
template <class _T1, class _T2> struct _LIBCPP_TEMPLATE_VIS is_convertible
1475
    : public __is_convertible<_T1, _T2>
1476
{
1477
    static const size_t __complete_check1 = __is_convertible_check<_T1>::__v;
1478
    static const size_t __complete_check2 = __is_convertible_check<_T2>::__v;
1479
};
1480
1481
#endif  // __has_feature(is_convertible_to)
1482
1483
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1484
template <class _From, class _To>
1485
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_convertible_v
1486
    = is_convertible<_From, _To>::value;
1487
#endif
1488
1489
// is_nothrow_convertible
1490
1491
#if _LIBCPP_STD_VER > 17
1492
1493
template <typename _Tp>
1494
static void __test_noexcept(_Tp) noexcept;
1495
1496
template<typename _Fm, typename _To>
1497
static bool_constant<noexcept(__test_noexcept<_To>(declval<_Fm>()))>
1498
__is_nothrow_convertible_test();
1499
1500
template <typename _Fm, typename _To>
1501
struct __is_nothrow_convertible_helper: decltype(__is_nothrow_convertible_test<_Fm, _To>())
1502
{ };
1503
1504
template <typename _Fm, typename _To>
1505
struct is_nothrow_convertible : _Or<
1506
    _And<is_void<_To>, is_void<_Fm>>,
1507
    _Lazy<_And, is_convertible<_Fm, _To>, __is_nothrow_convertible_helper<_Fm, _To>>
1508
>::type { };
1509
1510
template <typename _Fm, typename _To>
1511
inline constexpr bool is_nothrow_convertible_v = is_nothrow_convertible<_Fm, _To>::value;
1512
1513
#endif // _LIBCPP_STD_VER > 17
1514
1515
// is_empty
1516
1517
#if __has_feature(is_empty) || defined(_LIBCPP_COMPILER_GCC)
1518
1519
template <class _Tp>
1520
struct _LIBCPP_TEMPLATE_VIS is_empty
1521
    : public integral_constant<bool, __is_empty(_Tp)> {};
1522
1523
#else  // __has_feature(is_empty)
1524
1525
template <class _Tp>
1526
struct __is_empty1
1527
    : public _Tp
1528
{
1529
    double __lx;
1530
};
1531
1532
struct __is_empty2
1533
{
1534
    double __lx;
1535
};
1536
1537
template <class _Tp, bool = is_class<_Tp>::value>
1538
struct __libcpp_empty : public integral_constant<bool, sizeof(__is_empty1<_Tp>) == sizeof(__is_empty2)> {};
1539
1540
template <class _Tp> struct __libcpp_empty<_Tp, false> : public false_type {};
1541
1542
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_empty : public __libcpp_empty<_Tp> {};
1543
1544
#endif  // __has_feature(is_empty)
1545
1546
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1547
template <class _Tp>
1548
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_empty_v
1549
    = is_empty<_Tp>::value;
1550
#endif
1551
1552
// is_polymorphic
1553
1554
#if __has_feature(is_polymorphic) || defined(_LIBCPP_COMPILER_MSVC)
1555
1556
template <class _Tp>
1557
struct _LIBCPP_TEMPLATE_VIS is_polymorphic
1558
    : public integral_constant<bool, __is_polymorphic(_Tp)> {};
1559
1560
#else
1561
1562
template<typename _Tp> char &__is_polymorphic_impl(
1563
    typename enable_if<sizeof((_Tp*)dynamic_cast<const volatile void*>(declval<_Tp*>())) != 0,
1564
                       int>::type);
1565
template<typename _Tp> __two &__is_polymorphic_impl(...);
1566
1567
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_polymorphic
1568
    : public integral_constant<bool, sizeof(__is_polymorphic_impl<_Tp>(0)) == 1> {};
1569
1570
#endif // __has_feature(is_polymorphic)
1571
1572
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1573
template <class _Tp>
1574
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_polymorphic_v
1575
    = is_polymorphic<_Tp>::value;
1576
#endif
1577
1578
// has_virtual_destructor
1579
1580
#if __has_feature(has_virtual_destructor) || defined(_LIBCPP_COMPILER_GCC)
1581
1582
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_virtual_destructor
1583
    : public integral_constant<bool, __has_virtual_destructor(_Tp)> {};
1584
1585
#else
1586
1587
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_virtual_destructor
1588
    : public false_type {};
1589
1590
#endif
1591
1592
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1593
template <class _Tp>
1594
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool has_virtual_destructor_v
1595
    = has_virtual_destructor<_Tp>::value;
1596
#endif
1597
1598
// has_unique_object_representations
1599
1600
#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS)
1601
1602
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations
1603
    : public integral_constant<bool,
1604
       __has_unique_object_representations(remove_cv_t<remove_all_extents_t<_Tp>>)> {};
1605
1606
#if !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1607
template <class _Tp>
1608
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool has_unique_object_representations_v
1609
    = has_unique_object_representations<_Tp>::value;
1610
#endif
1611
1612
#endif
1613
1614
// alignment_of
1615
1616
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS alignment_of
1617
    : public integral_constant<size_t, _LIBCPP_ALIGNOF(_Tp)> {};
1618
1619
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
1620
template <class _Tp>
1621
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR size_t alignment_of_v
1622
    = alignment_of<_Tp>::value;
1623
#endif
1624
1625
// aligned_storage
1626
1627
template <class _Hp, class _Tp>
1628
struct __type_list
1629
{
1630
    typedef _Hp _Head;
1631
    typedef _Tp _Tail;
1632
};
1633
1634
struct __nat
1635
{
1636
#ifndef _LIBCPP_CXX03_LANG
1637
    __nat() = delete;
1638
    __nat(const __nat&) = delete;
1639
    __nat& operator=(const __nat&) = delete;
1640
    ~__nat() = delete;
1641
#endif
1642
};
1643
1644
template <class _Tp>
1645
struct __align_type
1646
{
1647
    static const size_t value = _LIBCPP_PREFERRED_ALIGNOF(_Tp);
1648
    typedef _Tp type;
1649
};
1650
1651
struct __struct_double {long double __lx;};
1652
struct __struct_double4 {double __lx[4];};
1653
1654
typedef
1655
    __type_list<__align_type<unsigned char>,
1656
    __type_list<__align_type<unsigned short>,
1657
    __type_list<__align_type<unsigned int>,
1658
    __type_list<__align_type<unsigned long>,
1659
    __type_list<__align_type<unsigned long long>,
1660
    __type_list<__align_type<double>,
1661
    __type_list<__align_type<long double>,
1662
    __type_list<__align_type<__struct_double>,
1663
    __type_list<__align_type<__struct_double4>,
1664
    __type_list<__align_type<int*>,
1665
    __nat
1666
    > > > > > > > > > > __all_types;
1667
1668
template <size_t _Align>
1669
struct _ALIGNAS(_Align) __fallback_overaligned {};
1670
1671
template <class _TL, size_t _Align> struct __find_pod;
1672
1673
template <class _Hp, size_t _Align>
1674
struct __find_pod<__type_list<_Hp, __nat>, _Align>
1675
{
1676
    typedef typename conditional<
1677
                             _Align == _Hp::value,
1678
                             typename _Hp::type,
1679
                             __fallback_overaligned<_Align>
1680
                         >::type type;
1681
};
1682
1683
template <class _Hp, class _Tp, size_t _Align>
1684
struct __find_pod<__type_list<_Hp, _Tp>, _Align>
1685
{
1686
    typedef typename conditional<
1687
                             _Align == _Hp::value,
1688
                             typename _Hp::type,
1689
                             typename __find_pod<_Tp, _Align>::type
1690
                         >::type type;
1691
};
1692
1693
template <class _TL, size_t _Len> struct __find_max_align;
1694
1695
template <class _Hp, size_t _Len>
1696
struct __find_max_align<__type_list<_Hp, __nat>, _Len> : public integral_constant<size_t, _Hp::value> {};
1697
1698
template <size_t _Len, size_t _A1, size_t _A2>
1699
struct __select_align
1700
{
1701
private:
1702
    static const size_t __min = _A2 < _A1 ? _A2 : _A1;
1703
    static const size_t __max = _A1 < _A2 ? _A2 : _A1;
1704
public:
1705
    static const size_t value = _Len < __max ? __min : __max;
1706
};
1707
1708
template <class _Hp, class _Tp, size_t _Len>
1709
struct __find_max_align<__type_list<_Hp, _Tp>, _Len>
1710
    : public integral_constant<size_t, __select_align<_Len, _Hp::value, __find_max_align<_Tp, _Len>::value>::value> {};
1711
1712
template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>
1713
struct _LIBCPP_TEMPLATE_VIS aligned_storage
1714
{
1715
    typedef typename __find_pod<__all_types, _Align>::type _Aligner;
1716
    union type
1717
    {
1718
        _Aligner __align;
1719
        unsigned char __data[(_Len + _Align - 1)/_Align * _Align];
1720
    };
1721
};
1722
1723
#if _LIBCPP_STD_VER > 11
1724
template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>
1725
    using aligned_storage_t = typename aligned_storage<_Len, _Align>::type;
1726
#endif
1727
1728
#define _CREATE_ALIGNED_STORAGE_SPECIALIZATION(n) \
1729
template <size_t _Len>\
1730
struct _LIBCPP_TEMPLATE_VIS aligned_storage<_Len, n>\
1731
{\
1732
    struct _ALIGNAS(n) type\
1733
    {\
1734
        unsigned char __lx[(_Len + n - 1)/n * n];\
1735
    };\
1736
}
1737
1738
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x1);
1739
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x2);
1740
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x4);
1741
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x8);
1742
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x10);
1743
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x20);
1744
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x40);
1745
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x80);
1746
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x100);
1747
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x200);
1748
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x400);
1749
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x800);
1750
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x1000);
1751
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x2000);
1752
// PE/COFF does not support alignment beyond 8192 (=0x2000)
1753
#if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
1754
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x4000);
1755
#endif // !defined(_LIBCPP_OBJECT_FORMAT_COFF)
1756
1757
#undef _CREATE_ALIGNED_STORAGE_SPECIALIZATION
1758
1759
1760
// aligned_union
1761
1762
template <size_t _I0, size_t ..._In>
1763
struct __static_max;
1764
1765
template <size_t _I0>
1766
struct __static_max<_I0>
1767
{
1768
    static const size_t value = _I0;
1769
};
1770
1771
template <size_t _I0, size_t _I1, size_t ..._In>
1772
struct __static_max<_I0, _I1, _In...>
1773
{
1774
    static const size_t value = _I0 >= _I1 ? __static_max<_I0, _In...>::value :
1775
                                             __static_max<_I1, _In...>::value;
1776
};
1777
1778
template <size_t _Len, class _Type0, class ..._Types>
1779
struct aligned_union
1780
{
1781
    static const size_t alignment_value = __static_max<_LIBCPP_PREFERRED_ALIGNOF(_Type0),
1782
                                                       _LIBCPP_PREFERRED_ALIGNOF(_Types)...>::value;
1783
    static const size_t __len = __static_max<_Len, sizeof(_Type0),
1784
                                             sizeof(_Types)...>::value;
1785
    typedef typename aligned_storage<__len, alignment_value>::type type;
1786
};
1787
1788
#if _LIBCPP_STD_VER > 11
1789
template <size_t _Len, class ..._Types> using aligned_union_t = typename aligned_union<_Len, _Types...>::type;
1790
#endif
1791
1792
template <class _Tp>
1793
struct __numeric_type
1794
{
1795
   static void __test(...);
1796
   static float __test(float);
1797
   static double __test(char);
1798
   static double __test(int);
1799
   static double __test(unsigned);
1800
   static double __test(long);
1801
   static double __test(unsigned long);
1802
   static double __test(long long);
1803
   static double __test(unsigned long long);
1804
   static double __test(double);
1805
   static long double __test(long double);
1806
1807
   typedef decltype(__test(declval<_Tp>())) type;
1808
   static const bool value = _IsNotSame<type, void>::value;
1809
};
1810
1811
template <>
1812
struct __numeric_type<void>
1813
{
1814
   static const bool value = true;
1815
};
1816
1817
// __promote
1818
1819
template <class _A1, class _A2 = void, class _A3 = void,
1820
          bool = __numeric_type<_A1>::value &&
1821
                 __numeric_type<_A2>::value &&
1822
                 __numeric_type<_A3>::value>
1823
class __promote_imp
1824
{
1825
public:
1826
    static const bool value = false;
1827
};
1828
1829
template <class _A1, class _A2, class _A3>
1830
class __promote_imp<_A1, _A2, _A3, true>
1831
{
1832
private:
1833
    typedef typename __promote_imp<_A1>::type __type1;
1834
    typedef typename __promote_imp<_A2>::type __type2;
1835
    typedef typename __promote_imp<_A3>::type __type3;
1836
public:
1837
    typedef decltype(__type1() + __type2() + __type3()) type;
1838
    static const bool value = true;
1839
};
1840
1841
template <class _A1, class _A2>
1842
class __promote_imp<_A1, _A2, void, true>
1843
{
1844
private:
1845
    typedef typename __promote_imp<_A1>::type __type1;
1846
    typedef typename __promote_imp<_A2>::type __type2;
1847
public:
1848
    typedef decltype(__type1() + __type2()) type;
1849
    static const bool value = true;
1850
};
1851
1852
template <class _A1>
1853
class __promote_imp<_A1, void, void, true>
1854
{
1855
public:
1856
    typedef typename __numeric_type<_A1>::type type;
1857
    static const bool value = true;
1858
};
1859
1860
template <class _A1, class _A2 = void, class _A3 = void>
1861
class __promote : public __promote_imp<_A1, _A2, _A3> {};
1862
1863
// make_signed / make_unsigned
1864
1865
typedef
1866
    __type_list<signed char,
1867
    __type_list<signed short,
1868
    __type_list<signed int,
1869
    __type_list<signed long,
1870
    __type_list<signed long long,
1871
#ifndef _LIBCPP_HAS_NO_INT128
1872
    __type_list<__int128_t,
1873
#endif
1874
    __nat
1875
#ifndef _LIBCPP_HAS_NO_INT128
1876
    >
1877
#endif
1878
    > > > > > __signed_types;
1879
1880
typedef
1881
    __type_list<unsigned char,
1882
    __type_list<unsigned short,
1883
    __type_list<unsigned int,
1884
    __type_list<unsigned long,
1885
    __type_list<unsigned long long,
1886
#ifndef _LIBCPP_HAS_NO_INT128
1887
    __type_list<__uint128_t,
1888
#endif
1889
    __nat
1890
#ifndef _LIBCPP_HAS_NO_INT128
1891
    >
1892
#endif
1893
    > > > > > __unsigned_types;
1894
1895
template <class _TypeList, size_t _Size, bool = _Size <= sizeof(typename _TypeList::_Head)> struct __find_first;
1896
1897
template <class _Hp, class _Tp, size_t _Size>
1898
struct __find_first<__type_list<_Hp, _Tp>, _Size, true>
1899
{
1900
    typedef _LIBCPP_NODEBUG_TYPE _Hp type;
1901
};
1902
1903
template <class _Hp, class _Tp, size_t _Size>
1904
struct __find_first<__type_list<_Hp, _Tp>, _Size, false>
1905
{
1906
    typedef _LIBCPP_NODEBUG_TYPE typename __find_first<_Tp, _Size>::type type;
1907
};
1908
1909
template <class _Tp, class _Up, bool = is_const<typename remove_reference<_Tp>::type>::value,
1910
                             bool = is_volatile<typename remove_reference<_Tp>::type>::value>
1911
struct __apply_cv
1912
{
1913
    typedef _LIBCPP_NODEBUG_TYPE _Up type;
1914
};
1915
1916
template <class _Tp, class _Up>
1917
struct __apply_cv<_Tp, _Up, true, false>
1918
{
1919
    typedef _LIBCPP_NODEBUG_TYPE const _Up type;
1920
};
1921
1922
template <class _Tp, class _Up>
1923
struct __apply_cv<_Tp, _Up, false, true>
1924
{
1925
    typedef volatile _Up type;
1926
};
1927
1928
template <class _Tp, class _Up>
1929
struct __apply_cv<_Tp, _Up, true, true>
1930
{
1931
    typedef const volatile _Up type;
1932
};
1933
1934
template <class _Tp, class _Up>
1935
struct __apply_cv<_Tp&, _Up, false, false>
1936
{
1937
    typedef _Up& type;
1938
};
1939
1940
template <class _Tp, class _Up>
1941
struct __apply_cv<_Tp&, _Up, true, false>
1942
{
1943
    typedef const _Up& type;
1944
};
1945
1946
template <class _Tp, class _Up>
1947
struct __apply_cv<_Tp&, _Up, false, true>
1948
{
1949
    typedef volatile _Up& type;
1950
};
1951
1952
template <class _Tp, class _Up>
1953
struct __apply_cv<_Tp&, _Up, true, true>
1954
{
1955
    typedef const volatile _Up& type;
1956
};
1957
1958
template <class _Tp, bool = is_integral<_Tp>::value || is_enum<_Tp>::value>
1959
struct __make_signed {};
1960
1961
template <class _Tp>
1962
struct __make_signed<_Tp, true>
1963
{
1964
    typedef typename __find_first<__signed_types, sizeof(_Tp)>::type type;
1965
};
1966
1967
template <> struct __make_signed<bool,               true> {};
1968
template <> struct __make_signed<  signed short,     true> {typedef short     type;};
1969
template <> struct __make_signed<unsigned short,     true> {typedef short     type;};
1970
template <> struct __make_signed<  signed int,       true> {typedef int       type;};
1971
template <> struct __make_signed<unsigned int,       true> {typedef int       type;};
1972
template <> struct __make_signed<  signed long,      true> {typedef long      type;};
1973
template <> struct __make_signed<unsigned long,      true> {typedef long      type;};
1974
template <> struct __make_signed<  signed long long, true> {typedef long long type;};
1975
template <> struct __make_signed<unsigned long long, true> {typedef long long type;};
1976
#ifndef _LIBCPP_HAS_NO_INT128
1977
template <> struct __make_signed<__int128_t,         true> {typedef __int128_t type;};
1978
template <> struct __make_signed<__uint128_t,        true> {typedef __int128_t type;};
1979
#endif
1980
1981
template <class _Tp>
1982
struct _LIBCPP_TEMPLATE_VIS make_signed
1983
{
1984
    typedef typename __apply_cv<_Tp, typename __make_signed<typename remove_cv<_Tp>::type>::type>::type type;
1985
};
1986
1987
#if _LIBCPP_STD_VER > 11
1988
template <class _Tp> using make_signed_t = typename make_signed<_Tp>::type;
1989
#endif
1990
1991
template <class _Tp, bool = is_integral<_Tp>::value || is_enum<_Tp>::value>
1992
struct __make_unsigned {};
1993
1994
template <class _Tp>
1995
struct __make_unsigned<_Tp, true>
1996
{
1997
    typedef typename __find_first<__unsigned_types, sizeof(_Tp)>::type type;
1998
};
1999
2000
template <> struct __make_unsigned<bool,               true> {};
2001
template <> struct __make_unsigned<  signed short,     true> {typedef unsigned short     type;};
2002
template <> struct __make_unsigned<unsigned short,     true> {typedef unsigned short     type;};
2003
template <> struct __make_unsigned<  signed int,       true> {typedef unsigned int       type;};
2004
template <> struct __make_unsigned<unsigned int,       true> {typedef unsigned int       type;};
2005
template <> struct __make_unsigned<  signed long,      true> {typedef unsigned long      type;};
2006
template <> struct __make_unsigned<unsigned long,      true> {typedef unsigned long      type;};
2007
template <> struct __make_unsigned<  signed long long, true> {typedef unsigned long long type;};
2008
template <> struct __make_unsigned<unsigned long long, true> {typedef unsigned long long type;};
2009
#ifndef _LIBCPP_HAS_NO_INT128
2010
template <> struct __make_unsigned<__int128_t,         true> {typedef __uint128_t        type;};
2011
template <> struct __make_unsigned<__uint128_t,        true> {typedef __uint128_t        type;};
2012
#endif
2013
2014
template <class _Tp>
2015
struct _LIBCPP_TEMPLATE_VIS make_unsigned
2016
{
2017
    typedef typename __apply_cv<_Tp, typename __make_unsigned<typename remove_cv<_Tp>::type>::type>::type type;
2018
};
2019
2020
#if _LIBCPP_STD_VER > 11
2021
template <class _Tp> using make_unsigned_t = typename make_unsigned<_Tp>::type;
2022
#endif
2023
2024
template <class _Tp, class _Up, class = void>
2025
struct __common_type2_imp {};
2026
2027
template <class _Tp, class _Up>
2028
struct __common_type2_imp<_Tp, _Up,
2029
                          typename __void_t<decltype(
2030
                                            true ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>()
2031
                                            )>::type>
2032
{
2033
  typedef _LIBCPP_NODEBUG_TYPE typename decay<decltype(
2034
                         true ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>()
2035
                         )>::type type;
2036
};
2037
2038
template <class, class = void>
2039
struct __common_type_impl {};
2040
2041
// Clang provides variadic templates in C++03 as an extension.
2042
#if !defined(_LIBCPP_CXX03_LANG) || defined(__clang__)
2043
# define _LIBCPP_OPTIONAL_PACK(...) , __VA_ARGS__
2044
template <class... Tp>
2045
struct __common_types;
2046
template <class... _Tp>
2047
struct _LIBCPP_TEMPLATE_VIS common_type;
2048
#else
2049
# define _LIBCPP_OPTIONAL_PACK(...)
2050
struct __no_arg;
2051
template <class _Tp, class _Up, class = __no_arg>
2052
struct __common_types;
2053
template <class _Tp = __no_arg, class _Up = __no_arg, class _Vp = __no_arg,
2054
          class _Unused = __no_arg>
2055
struct common_type {
2056
  static_assert(sizeof(_Unused) == 0,
2057
                "common_type accepts at most 3 arguments in C++03");
2058
};
2059
#endif // _LIBCPP_CXX03_LANG
2060
2061
template <class _Tp, class _Up>
2062
struct __common_type_impl<
2063
    __common_types<_Tp, _Up>,
2064
    typename __void_t<typename common_type<_Tp, _Up>::type>::type>
2065
{
2066
  typedef typename common_type<_Tp, _Up>::type type;
2067
};
2068
2069
template <class _Tp, class _Up, class _Vp _LIBCPP_OPTIONAL_PACK(class... _Rest)>
2070
struct __common_type_impl<
2071
    __common_types<_Tp, _Up, _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)>,
2072
    typename __void_t<typename common_type<_Tp, _Up>::type>::type>
2073
    : __common_type_impl<__common_types<typename common_type<_Tp, _Up>::type,
2074
                                        _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)> > {
2075
};
2076
2077
// bullet 1 - sizeof...(Tp) == 0
2078
2079
template <>
2080
struct _LIBCPP_TEMPLATE_VIS common_type<> {};
2081
2082
// bullet 2 - sizeof...(Tp) == 1
2083
2084
template <class _Tp>
2085
struct _LIBCPP_TEMPLATE_VIS common_type<_Tp>
2086
    : public common_type<_Tp, _Tp> {};
2087
2088
// bullet 3 - sizeof...(Tp) == 2
2089
2090
template <class _Tp, class _Up>
2091
struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, _Up>
2092
    : conditional<
2093
        _IsSame<_Tp, typename decay<_Tp>::type>::value && _IsSame<_Up, typename decay<_Up>::type>::value,
2094
        __common_type2_imp<_Tp, _Up>,
2095
        common_type<typename decay<_Tp>::type, typename decay<_Up>::type>
2096
    >::type
2097
{};
2098
2099
// bullet 4 - sizeof...(Tp) > 2
2100
2101
template <class _Tp, class _Up, class _Vp _LIBCPP_OPTIONAL_PACK(class... _Rest)>
2102
struct _LIBCPP_TEMPLATE_VIS
2103
    common_type<_Tp, _Up, _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)>
2104
    : __common_type_impl<
2105
          __common_types<_Tp, _Up, _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)> > {};
2106
2107
#undef _LIBCPP_OPTIONAL_PACK
2108
2109
#if _LIBCPP_STD_VER > 11
2110
template <class ..._Tp> using common_type_t = typename common_type<_Tp...>::type;
2111
#endif
2112
2113
// is_assignable
2114
2115
template<typename, typename _Tp> struct __select_2nd { typedef _LIBCPP_NODEBUG_TYPE _Tp type; };
2116
2117
template <class _Tp, class _Arg>
2118
typename __select_2nd<decltype((_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>())), true_type>::type
2119
__is_assignable_test(int);
2120
2121
template <class, class>
2122
false_type __is_assignable_test(...);
2123
2124
2125
template <class _Tp, class _Arg, bool = is_void<_Tp>::value || is_void<_Arg>::value>
2126
struct __is_assignable_imp
2127
    : public decltype((_VSTD::__is_assignable_test<_Tp, _Arg>(0))) {};
2128
2129
template <class _Tp, class _Arg>
2130
struct __is_assignable_imp<_Tp, _Arg, true>
2131
    : public false_type
2132
{
2133
};
2134
2135
template <class _Tp, class _Arg>
2136
struct is_assignable
2137
    : public __is_assignable_imp<_Tp, _Arg> {};
2138
2139
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
2140
template <class _Tp, class _Arg>
2141
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_assignable_v
2142
    = is_assignable<_Tp, _Arg>::value;
2143
#endif
2144
2145
// is_copy_assignable
2146
2147
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_copy_assignable
2148
    : public is_assignable<typename add_lvalue_reference<_Tp>::type,
2149
                  typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
2150
2151
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
2152
template <class _Tp>
2153
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_copy_assignable_v
2154
    = is_copy_assignable<_Tp>::value;
2155
#endif
2156
2157
// is_move_assignable
2158
2159
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_move_assignable
2160
    : public is_assignable<typename add_lvalue_reference<_Tp>::type,
2161
                           typename add_rvalue_reference<_Tp>::type> {};
2162
2163
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
2164
template <class _Tp>
2165
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_move_assignable_v
2166
    = is_move_assignable<_Tp>::value;
2167
#endif
2168
2169
// is_destructible
2170
2171
//  if it's a reference, return true
2172
//  if it's a function, return false
2173
//  if it's   void,     return false
2174
//  if it's an array of unknown bound, return false
2175
//  Otherwise, return "std::declval<_Up&>().~_Up()" is well-formed
2176
//    where _Up is remove_all_extents<_Tp>::type
2177
2178
template <class>
2179
struct __is_destructible_apply { typedef int type; };
2180
2181
template <typename _Tp>
2182
struct __is_destructor_wellformed {
2183
    template <typename _Tp1>
2184
    static char  __test (
2185
        typename __is_destructible_apply<decltype(_VSTD::declval<_Tp1&>().~_Tp1())>::type
2186
    );
2187
2188
    template <typename _Tp1>
2189
    static __two __test (...);
2190
2191
    static const bool value = sizeof(__test<_Tp>(12)) == sizeof(char);
2192
};
2193
2194
template <class _Tp, bool>
2195
struct __destructible_imp;
2196
2197
template <class _Tp>
2198
struct __destructible_imp<_Tp, false>
2199
   : public _VSTD::integral_constant<bool,
2200
        __is_destructor_wellformed<typename _VSTD::remove_all_extents<_Tp>::type>::value> {};
2201
2202
template <class _Tp>
2203
struct __destructible_imp<_Tp, true>
2204
    : public _VSTD::true_type {};
2205
2206
template <class _Tp, bool>
2207
struct __destructible_false;
2208
2209
template <class _Tp>
2210
struct __destructible_false<_Tp, false> : public __destructible_imp<_Tp, _VSTD::is_reference<_Tp>::value> {};
2211
2212
template <class _Tp>
2213
struct __destructible_false<_Tp, true> : public _VSTD::false_type {};
2214
2215
template <class _Tp>
2216
struct is_destructible
2217
    : public __destructible_false<_Tp, _VSTD::is_function<_Tp>::value> {};
2218
2219
template <class _Tp>
2220
struct is_destructible<_Tp[]>
2221
    : public _VSTD::false_type {};
2222
2223
template <>
2224
struct is_destructible<void>
2225
    : public _VSTD::false_type {};
2226
2227
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
2228
template <class _Tp>
2229
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_destructible_v
2230
    = is_destructible<_Tp>::value;
2231
#endif
2232
2233
// move
2234
2235
template <class _Tp>
2236
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
2237
typename remove_reference<_Tp>::type&&
2238
move(_Tp&& __t) _NOEXCEPT
2239
9.43G
{
2240
9.43G
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
9.43G
    return static_cast<_Up&&>(__t);
2242
9.43G
}
std::__1::remove_reference<char&>::type&& std::__1::move<char&>(char&&&)
Line
Count
Source
2239
83.3M
{
2240
83.3M
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
83.3M
    return static_cast<_Up&&>(__t);
2242
83.3M
}
Unexecuted instantiation: std::__1::remove_reference<wchar_t&>::type&& std::__1::move<wchar_t&>(wchar_t&&&)
std::__1::remove_reference<signed char&>::type&& std::__1::move<signed char&>(signed char&&&)
Line
Count
Source
2239
2
{
2240
2
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
2
    return static_cast<_Up&&>(__t);
2242
2
}
std::__1::remove_reference<unsigned char&>::type&& std::__1::move<unsigned char&>(unsigned char&&&)
Line
Count
Source
2239
23.8M
{
2240
23.8M
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
23.8M
    return static_cast<_Up&&>(__t);
2242
23.8M
}
std::__1::remove_reference<short&>::type&& std::__1::move<short&>(short&&&)
Line
Count
Source
2239
297
{
2240
297
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
297
    return static_cast<_Up&&>(__t);
2242
297
}
std::__1::remove_reference<unsigned short&>::type&& std::__1::move<unsigned short&>(unsigned short&&&)
Line
Count
Source
2239
32.0M
{
2240
32.0M
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
32.0M
    return static_cast<_Up&&>(__t);
2242
32.0M
}
std::__1::remove_reference<int&>::type&& std::__1::move<int&>(int&&&)
Line
Count
Source
2239
178M
{
2240
178M
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
178M
    return static_cast<_Up&&>(__t);
2242
178M
}
std::__1::remove_reference<unsigned int&>::type&& std::__1::move<unsigned int&>(unsigned int&&&)
Line
Count
Source
2239
3.15G
{
2240
3.15G
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
3.15G
    return static_cast<_Up&&>(__t);
2242
3.15G
}
std::__1::remove_reference<long&>::type&& std::__1::move<long&>(long&&&)
Line
Count
Source
2239
13.1k
{
2240
13.1k
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
13.1k
    return static_cast<_Up&&>(__t);
2242
13.1k
}
std::__1::remove_reference<unsigned long&>::type&& std::__1::move<unsigned long&>(unsigned long&&&)
Line
Count
Source
2239
1.79G
{
2240
1.79G
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
1.79G
    return static_cast<_Up&&>(__t);
2242
1.79G
}
std::__1::remove_reference<long long&>::type&& std::__1::move<long long&>(long long&&&)
Line
Count
Source
2239
10.3M
{
2240
10.3M
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
10.3M
    return static_cast<_Up&&>(__t);
2242
10.3M
}
std::__1::remove_reference<unsigned long long&>::type&& std::__1::move<unsigned long long&>(unsigned long long&&&)
Line
Count
Source
2239
868M
{
2240
868M
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
868M
    return static_cast<_Up&&>(__t);
2242
868M
}
std::__1::remove_reference<float&>::type&& std::__1::move<float&>(float&&&)
Line
Count
Source
2239
898
{
2240
898
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
898
    return static_cast<_Up&&>(__t);
2242
898
}
std::__1::remove_reference<double&>::type&& std::__1::move<double&>(double&&&)
Line
Count
Source
2239
45.4k
{
2240
45.4k
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
45.4k
    return static_cast<_Up&&>(__t);
2242
45.4k
}
Unexecuted instantiation: std::__1::remove_reference<long double&>::type&& std::__1::move<long double&>(long double&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::__builtin_new_allocator::__builtin_new_deleter&>::type&& std::__1::move<std::__1::__builtin_new_allocator::__builtin_new_deleter&>(std::__1::__builtin_new_allocator::__builtin_new_deleter&&&)
std::__1::remove_reference<std::__1::__compressed_pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__rep, std::__1::allocator<char> >&>::type&& std::__1::move<std::__1::__compressed_pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__rep, std::__1::allocator<char> >&>(std::__1::__compressed_pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__rep, std::__1::allocator<char> >&&&)
Line
Count
Source
2239
381M
{
2240
381M
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
381M
    return static_cast<_Up&&>(__t);
2242
381M
}
std::__1::remove_reference<std::__1::__compressed_pair<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::__rep, std::__1::allocator<wchar_t> >&>::type&& std::__1::move<std::__1::__compressed_pair<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::__rep, std::__1::allocator<wchar_t> >&>(std::__1::__compressed_pair<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::__rep, std::__1::allocator<wchar_t> >&&&)
Line
Count
Source
2239
74
{
2240
74
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
74
    return static_cast<_Up&&>(__t);
2242
74
}
Unexecuted instantiation: std::__1::remove_reference<std::__1::__compressed_pair<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> >::__rep, std::__1::allocator<char16_t> >&>::type&& std::__1::move<std::__1::__compressed_pair<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> >::__rep, std::__1::allocator<char16_t> >&>(std::__1::__compressed_pair<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> >::__rep, std::__1::allocator<char16_t> >&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::__compressed_pair<std::__1::basic_string<char32_t, std::__1::char_traits<char32_t>, std::__1::allocator<char32_t> >::__rep, std::__1::allocator<char32_t> >&>::type&& std::__1::move<std::__1::__compressed_pair<std::__1::basic_string<char32_t, std::__1::char_traits<char32_t>, std::__1::allocator<char32_t> >::__rep, std::__1::allocator<char32_t> >&>(std::__1::__compressed_pair<std::__1::basic_string<char32_t, std::__1::char_traits<char32_t>, std::__1::allocator<char32_t> >::__rep, std::__1::allocator<char32_t> >&&&)
Unexecuted instantiation: std::__1::remove_reference<_opaque_pthread_t*&>::type&& std::__1::move<_opaque_pthread_t*&>(_opaque_pthread_t*&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::mutex, std::__1::allocator<std::__1::mutex> > > >&>::type&& std::__1::move<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::mutex, std::__1::allocator<std::__1::mutex> > > >&>(std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::mutex, std::__1::allocator<std::__1::mutex> > > >&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::allocator<std::__1::mutex>&>::type&& std::__1::move<std::__1::allocator<std::__1::mutex>&>(std::__1::allocator<std::__1::mutex>&&&)
std::__1::remove_reference<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>::type&& std::__1::move<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&&)
Line
Count
Source
2239
340M
{
2240
340M
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
340M
    return static_cast<_Up&&>(__t);
2242
340M
}
Unexecuted instantiation: std::__1::remove_reference<std::__1::__i_node**&>::type&& std::__1::move<std::__1::__i_node**&>(std::__1::__i_node**&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::shared_future<void>&>::type&& std::__1::move<std::__1::shared_future<void>&>(std::__1::shared_future<void>&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::locale&>::type&& std::__1::move<std::__1::locale&>(std::__1::locale&&&)
std::__1::remove_reference<char*&>::type&& std::__1::move<char*&>(char*&&&)
Line
Count
Source
2239
2.65M
{
2240
2.65M
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
2.65M
    return static_cast<_Up&&>(__t);
2242
2.65M
}
Unexecuted instantiation: std::__1::remove_reference<wchar_t*&>::type&& std::__1::move<wchar_t*&>(wchar_t*&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::basic_ostream<char, std::__1::char_traits<char> >*&>::type&& std::__1::move<std::__1::basic_ostream<char, std::__1::char_traits<char> >*&>(std::__1::basic_ostream<char, std::__1::char_traits<char> >*&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >*&>::type&& std::__1::move<std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >*&>(std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >*&&&)
std::__1::remove_reference<void (*&)(void*)>::type&& std::__1::move<void (*&)(void*)>(void (*&&&)(void*))
Line
Count
Source
2239
6
{
2240
6
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
6
    return static_cast<_Up&&>(__t);
2242
6
}
Unexecuted instantiation: std::__1::remove_reference<void (**&)(std::__1::ios_base::event, std::__1::ios_base&, int)>::type&& std::__1::move<void (**&)(std::__1::ios_base::event, std::__1::ios_base&, int)>(void (**&&&)(std::__1::ios_base::event, std::__1::ios_base&, int))
std::__1::remove_reference<int*&>::type&& std::__1::move<int*&>(int*&&&)
Line
Count
Source
2239
28.6M
{
2240
28.6M
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
28.6M
    return static_cast<_Up&&>(__t);
2242
28.6M
}
Unexecuted instantiation: std::__1::remove_reference<long*&>::type&& std::__1::move<long*&>(long*&&&)
std::__1::remove_reference<void**&>::type&& std::__1::move<void**&>(void**&&&)
Line
Count
Source
2239
19.5M
{
2240
19.5M
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
19.5M
    return static_cast<_Up&&>(__t);
2242
19.5M
}
Unexecuted instantiation: std::__1::remove_reference<std::__1::locale::facet**&>::type&& std::__1::move<std::__1::locale::facet**&>(std::__1::locale::facet**&&&)
locale.cpp:std::__1::remove_reference<std::__1::tuple<std::__1::(anonymous namespace)::__fake_bind&&>&>::type&& std::__1::move<std::__1::tuple<std::__1::(anonymous namespace)::__fake_bind&&>&>(std::__1::tuple<std::__1::(anonymous namespace)::__fake_bind&&>&&&)
Line
Count
Source
2239
144k
{
2240
144k
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
144k
    return static_cast<_Up&&>(__t);
2242
144k
}
std::__1::remove_reference<std::__1::allocator<char>&>::type&& std::__1::move<std::__1::allocator<char>&>(std::__1::allocator<char>&&&)
Line
Count
Source
2239
89.1M
{
2240
89.1M
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
89.1M
    return static_cast<_Up&&>(__t);
2242
89.1M
}
std::__1::remove_reference<std::__1::allocator<wchar_t>&>::type&& std::__1::move<std::__1::allocator<wchar_t>&>(std::__1::allocator<wchar_t>&&&)
Line
Count
Source
2239
5
{
2240
5
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
5
    return static_cast<_Up&&>(__t);
2242
5
}
Unexecuted instantiation: std::__1::remove_reference<void* (*&)(unsigned long)>::type&& std::__1::move<void* (*&)(unsigned long)>(void* (*&&&)(unsigned long))
Unexecuted instantiation: std::__1::remove_reference<std::__1::istrstream&>::type&& std::__1::move<std::__1::istrstream&>(std::__1::istrstream&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::strstreambuf&>::type&& std::__1::move<std::__1::strstreambuf&>(std::__1::strstreambuf&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::ostrstream&>::type&& std::__1::move<std::__1::ostrstream&>(std::__1::ostrstream&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::strstream&>::type&& std::__1::move<std::__1::strstream&>(std::__1::strstream&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::basic_iostream<char, std::__1::char_traits<char> >&>::type&& std::__1::move<std::__1::basic_iostream<char, std::__1::char_traits<char> >&>(std::__1::basic_iostream<char, std::__1::char_traits<char> >&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::pair<std::__1::condition_variable*, std::__1::mutex*>&>::type&& std::__1::move<std::__1::pair<std::__1::condition_variable*, std::__1::mutex*>&>(std::__1::pair<std::__1::condition_variable*, std::__1::mutex*>&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::pair<std::__1::condition_variable*, std::__1::mutex*>*&>::type&& std::__1::move<std::__1::pair<std::__1::condition_variable*, std::__1::mutex*>*&>(std::__1::pair<std::__1::condition_variable*, std::__1::mutex*>*&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::__assoc_sub_state**&>::type&& std::__1::move<std::__1::__assoc_sub_state**&>(std::__1::__assoc_sub_state**&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::valarray<unsigned long>&>::type&& std::__1::move<std::__1::valarray<unsigned long>&>(std::__1::valarray<unsigned long>&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::gslice&>::type&& std::__1::move<std::__1::gslice&>(std::__1::gslice&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::valarray<bool>&>::type&& std::__1::move<std::__1::valarray<bool>&>(std::__1::valarray<bool>&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::filesystem_error::_Storage, std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage> > > >&>::type&& std::__1::move<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::filesystem_error::_Storage, std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage> > > >&>(std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::filesystem_error::_Storage, std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage> > > >&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::tuple<std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage>&>&>::type&& std::__1::move<std::__1::tuple<std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage>&>&>(std::__1::tuple<std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage>&>&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::tuple<std::__1::__fs::filesystem::path&&, std::__1::__fs::filesystem::path&&>&>::type&& std::__1::move<std::__1::tuple<std::__1::__fs::filesystem::path&&, std::__1::__fs::filesystem::path&&>&>(std::__1::tuple<std::__1::__fs::filesystem::path&&, std::__1::__fs::filesystem::path&&>&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::tuple<std::__1::__fs::filesystem::path const&, std::__1::__fs::filesystem::path&&>&>::type&& std::__1::move<std::__1::tuple<std::__1::__fs::filesystem::path const&, std::__1::__fs::filesystem::path&&>&>(std::__1::tuple<std::__1::__fs::filesystem::path const&, std::__1::__fs::filesystem::path&&>&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::tuple<std::__1::__fs::filesystem::path const&, std::__1::__fs::filesystem::path const&>&>::type&& std::__1::move<std::__1::tuple<std::__1::__fs::filesystem::path const&, std::__1::__fs::filesystem::path const&>&>(std::__1::tuple<std::__1::__fs::filesystem::path const&, std::__1::__fs::filesystem::path const&>&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__fs::filesystem::PathPartKind>*&>::type&& std::__1::move<std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__fs::filesystem::PathPartKind>*&>(std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__fs::filesystem::PathPartKind>*&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::basic_string_view<char, std::__1::char_traits<char> >&>::type&& std::__1::move<std::__1::basic_string_view<char, std::__1::char_traits<char> >&>(std::__1::basic_string_view<char, std::__1::char_traits<char> >&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::basic_string_view<char, std::__1::char_traits<char> >*&>::type&& std::__1::move<std::__1::basic_string_view<char, std::__1::char_traits<char> >*&>(std::__1::basic_string_view<char, std::__1::char_traits<char> >*&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::__fs::filesystem::path&>::type&& std::__1::move<std::__1::__fs::filesystem::path&>(std::__1::__fs::filesystem::path&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::__fs::filesystem::directory_entry&>::type&& std::__1::move<std::__1::__fs::filesystem::directory_entry&>(std::__1::__fs::filesystem::directory_entry&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::shared_ptr<std::__1::__fs::filesystem::__dir_stream>&>::type&& std::__1::move<std::__1::shared_ptr<std::__1::__fs::filesystem::__dir_stream>&>(std::__1::shared_ptr<std::__1::__fs::filesystem::__dir_stream>&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::shared_ptr<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp>&>::type&& std::__1::move<std::__1::shared_ptr<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp>&>(std::__1::shared_ptr<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp>&&&)
Unexecuted instantiation: std::__1::remove_reference<char16_t&>::type&& std::__1::move<char16_t&>(char16_t&&&)
Unexecuted instantiation: std::__1::remove_reference<char32_t&>::type&& std::__1::move<char32_t&>(char32_t&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::__fs::filesystem::__dir_stream*&>::type&& std::__1::move<std::__1::__fs::filesystem::__dir_stream*&>(std::__1::__fs::filesystem::__dir_stream*&&&)
std::__1::remove_reference<std::__1::__shared_weak_count*&>::type&& std::__1::move<std::__1::__shared_weak_count*&>(std::__1::__shared_weak_count*&&&)
Line
Count
Source
2239
2.42G
{
2240
2.42G
    typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
2241
2.42G
    return static_cast<_Up&&>(__t);
2242
2.42G
}
Unexecuted instantiation: std::__1::remove_reference<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp*&>::type&& std::__1::move<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp*&>(std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp*&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::__fs::filesystem::__dir_stream&>::type&& std::__1::move<std::__1::__fs::filesystem::__dir_stream&>(std::__1::__fs::filesystem::__dir_stream&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::__dir_stream, std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> > > >&>::type&& std::__1::move<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::__dir_stream, std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> > > >&>(std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::__dir_stream, std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> > > >&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::tuple<std::__1::allocator<std::__1::__fs::filesystem::__dir_stream>&>&>::type&& std::__1::move<std::__1::tuple<std::__1::allocator<std::__1::__fs::filesystem::__dir_stream>&>&>(std::__1::tuple<std::__1::allocator<std::__1::__fs::filesystem::__dir_stream>&>&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::tuple<std::__1::__fs::filesystem::path const&, std::__1::__fs::filesystem::directory_options&, std::__1::error_code&>&>::type&& std::__1::move<std::__1::tuple<std::__1::__fs::filesystem::path const&, std::__1::__fs::filesystem::directory_options&, std::__1::error_code&>&>(std::__1::tuple<std::__1::__fs::filesystem::path const&, std::__1::__fs::filesystem::directory_options&, std::__1::error_code&>&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp, std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp> > > >&>::type&& std::__1::move<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp, std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp> > > >&>(std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp, std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp> > > >&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp>&>::type&& std::__1::move<std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp>&>(std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp>&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> >&>::type&& std::__1::move<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> >&>(std::__1::__allocator_destructor<std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> >&&&)
Unexecuted instantiation: std::__1::remove_reference<std::__1::__fs::filesystem::__dir_stream**&>::type&& std::__1::move<std::__1::__fs::filesystem::__dir_stream**&>(std::__1::__fs::filesystem::__dir_stream**&&&)
2243
2244
template <class _Tp>
2245
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
2246
_Tp&&
2247
forward(typename remove_reference<_Tp>::type& __t) _NOEXCEPT
2248
10.7G
{
2249
10.7G
    return static_cast<_Tp&&>(__t);
2250
10.7G
}
unsigned long&& std::__1::forward<unsigned long>(std::__1::remove_reference<unsigned long>::type&)
Line
Count
Source
2248
2.09G
{
2249
2.09G
    return static_cast<_Tp&&>(__t);
2250
2.09G
}
Unexecuted instantiation: std::__1::__builtin_new_allocator::__builtin_new_deleter&& std::__1::forward<std::__1::__builtin_new_allocator::__builtin_new_deleter>(std::__1::remove_reference<std::__1::__builtin_new_allocator::__builtin_new_deleter>::type&)
std::__1::__default_init_tag&& std::__1::forward<std::__1::__default_init_tag>(std::__1::remove_reference<std::__1::__default_init_tag>::type&)
Line
Count
Source
2248
3.28G
{
2249
3.28G
    return static_cast<_Tp&&>(__t);
2250
3.28G
}
std::nullptr_t&& std::__1::forward<std::nullptr_t>(std::__1::remove_reference<std::nullptr_t>::type&)
Line
Count
Source
2248
4.19G
{
2249
4.19G
    return static_cast<_Tp&&>(__t);
2250
4.19G
}
Unexecuted instantiation: std::__1::__barrier_algorithm_base::__state_t*&&& std::__1::forward<std::__1::__barrier_algorithm_base::__state_t*&>(std::__1::remove_reference<std::__1::__barrier_algorithm_base::__state_t*&>::type&)
Unexecuted instantiation: std::__1::__shared_ptr_emplace<std::__1::mutex, std::__1::allocator<std::__1::mutex> >*&&& std::__1::forward<std::__1::__shared_ptr_emplace<std::__1::mutex, std::__1::allocator<std::__1::mutex> >*&>(std::__1::remove_reference<std::__1::__shared_ptr_emplace<std::__1::mutex, std::__1::allocator<std::__1::mutex> >*&>::type&)
Unexecuted instantiation: std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::mutex, std::__1::allocator<std::__1::mutex> > > >&& std::__1::forward<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::mutex, std::__1::allocator<std::__1::mutex> > > > >(std::__1::remove_reference<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::mutex, std::__1::allocator<std::__1::mutex> > > > >::type&)
Unexecuted instantiation: std::__1::allocator<std::__1::mutex>&& std::__1::forward<std::__1::allocator<std::__1::mutex> >(std::__1::remove_reference<std::__1::allocator<std::__1::mutex> >::type&)
std::__1::__value_init_tag&& std::__1::forward<std::__1::__value_init_tag>(std::__1::remove_reference<std::__1::__value_init_tag>::type&)
Line
Count
Source
2248
2.37M
{
2249
2.37M
    return static_cast<_Tp&&>(__t);
2250
2.37M
}
std::__1::__shared_count*&&& std::__1::forward<std::__1::__shared_count*&>(std::__1::remove_reference<std::__1::__shared_count*&>::type&)
Line
Count
Source
2248
6.42k
{
2249
6.42k
    return static_cast<_Tp&&>(__t);
2250
6.42k
}
Unexecuted instantiation: void (**&&&std::__1::forward<void (**&)(std::__1::ios_base::event, std::__1::ios_base&, int)>(std::__1::remove_reference<void (**&)(std::__1::ios_base::event, std::__1::ios_base&, int)>::type&))(std::__1::ios_base::event, std::__1::ios_base&, int)
void (*&&std::__1::forward<void (*)(void*)>(std::__1::remove_reference<void (*)(void*)>::type&))(void*)
Line
Count
Source
2248
12
{
2249
12
    return static_cast<_Tp&&>(__t);
2250
12
}
int*&&& std::__1::forward<int*&>(std::__1::remove_reference<int*&>::type&)
Line
Count
Source
2248
126k
{
2249
126k
    return static_cast<_Tp&&>(__t);
2250
126k
}
Unexecuted instantiation: long*&&& std::__1::forward<long*&>(std::__1::remove_reference<long*&>::type&)
Unexecuted instantiation: void**&&& std::__1::forward<void**&>(std::__1::remove_reference<void**&>::type&)
std::__1::locale::facet*&&& std::__1::forward<std::__1::locale::facet*&>(std::__1::remove_reference<std::__1::locale::facet*&>::type&)
Line
Count
Source
2248
288k
{
2249
288k
    return static_cast<_Tp&&>(__t);
2250
288k
}
Unexecuted instantiation: std::__1::__sso_allocator<std::__1::locale::facet*, 28ul>&&& std::__1::forward<std::__1::__sso_allocator<std::__1::locale::facet*, 28ul>&>(std::__1::remove_reference<std::__1::__sso_allocator<std::__1::locale::facet*, 28ul>&>::type&)
locale.cpp:std::__1::(anonymous namespace)::__fake_bind&& std::__1::forward<std::__1::(anonymous namespace)::__fake_bind>(std::__1::remove_reference<std::__1::(anonymous namespace)::__fake_bind>::type&)
Line
Count
Source
2248
721k
{
2249
721k
    return static_cast<_Tp&&>(__t);
2250
721k
}
unsigned char*&&& std::__1::forward<unsigned char*&>(std::__1::remove_reference<unsigned char*&>::type&)
Line
Count
Source
2248
637k
{
2249
637k
    return static_cast<_Tp&&>(__t);
2250
637k
}
char*&&& std::__1::forward<char*&>(std::__1::remove_reference<char*&>::type&)
Line
Count
Source
2248
235k
{
2249
235k
    return static_cast<_Tp&&>(__t);
2250
235k
}
wchar_t*&&& std::__1::forward<wchar_t*&>(std::__1::remove_reference<wchar_t*&>::type&)
Line
Count
Source
2248
12
{
2249
12
    return static_cast<_Tp&&>(__t);
2250
12
}
std::__1::allocator<char> const&&& std::__1::forward<std::__1::allocator<char> const&>(std::__1::remove_reference<std::__1::allocator<char> const&>::type&)
Line
Count
Source
2248
70.3M
{
2249
70.3M
    return static_cast<_Tp&&>(__t);
2250
70.3M
}
unsigned int*&&& std::__1::forward<unsigned int*&>(std::__1::remove_reference<unsigned int*&>::type&)
Line
Count
Source
2248
5.94M
{
2249
5.94M
    return static_cast<_Tp&&>(__t);
2250
5.94M
}
std::__1::allocator<wchar_t> const&&& std::__1::forward<std::__1::allocator<wchar_t> const&>(std::__1::remove_reference<std::__1::allocator<wchar_t> const&>::type&)
Line
Count
Source
2248
4
{
2249
4
    return static_cast<_Tp&&>(__t);
2250
4
}
std::__1::allocator<char>&& std::__1::forward<std::__1::allocator<char> >(std::__1::remove_reference<std::__1::allocator<char> >::type&)
Line
Count
Source
2248
203M
{
2249
203M
    return static_cast<_Tp&&>(__t);
2250
203M
}
Unexecuted instantiation: std::__1::allocator<wchar_t>&& std::__1::forward<std::__1::allocator<wchar_t> >(std::__1::remove_reference<std::__1::allocator<wchar_t> >::type&)
Unexecuted instantiation: std::__1::condition_variable*&&& std::__1::forward<std::__1::condition_variable*&>(std::__1::remove_reference<std::__1::condition_variable*&>::type&)
Unexecuted instantiation: std::__1::mutex*&&& std::__1::forward<std::__1::mutex*&>(std::__1::remove_reference<std::__1::mutex*&>::type&)
Unexecuted instantiation: std::__1::pair<std::__1::condition_variable*, std::__1::mutex*>&& std::__1::forward<std::__1::pair<std::__1::condition_variable*, std::__1::mutex*> >(std::__1::remove_reference<std::__1::pair<std::__1::condition_variable*, std::__1::mutex*> >::type&)
Unexecuted instantiation: std::__1::__hidden_allocator<std::__1::pair<std::__1::condition_variable*, std::__1::mutex*> >&&& std::__1::forward<std::__1::__hidden_allocator<std::__1::pair<std::__1::condition_variable*, std::__1::mutex*> >&>(std::__1::remove_reference<std::__1::__hidden_allocator<std::__1::pair<std::__1::condition_variable*, std::__1::mutex*> >&>::type&)
Unexecuted instantiation: std::__1::__assoc_sub_state* const&&& std::__1::forward<std::__1::__assoc_sub_state* const&>(std::__1::remove_reference<std::__1::__assoc_sub_state* const&>::type&)
Unexecuted instantiation: std::__1::__hidden_allocator<std::__1::__assoc_sub_state*>&&& std::__1::forward<std::__1::__hidden_allocator<std::__1::__assoc_sub_state*>&>(std::__1::remove_reference<std::__1::__hidden_allocator<std::__1::__assoc_sub_state*>&>::type&)
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&& std::__1::forward<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::remove_reference<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>::type&)
Line
Count
Source
2248
151M
{
2249
151M
    return static_cast<_Tp&&>(__t);
2250
151M
}
Unexecuted instantiation: std::__1::error_code const&&& std::__1::forward<std::__1::error_code const&>(std::__1::remove_reference<std::__1::error_code const&>::type&)
Unexecuted instantiation: std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::filesystem_error::_Storage, std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage> >*&&& std::__1::forward<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::filesystem_error::_Storage, std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage> >*&>(std::__1::remove_reference<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::filesystem_error::_Storage, std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage> >*&>::type&)
Unexecuted instantiation: std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::filesystem_error::_Storage, std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage> > > >&& std::__1::forward<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::filesystem_error::_Storage, std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage> > > > >(std::__1::remove_reference<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::filesystem_error::_Storage, std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage> > > > >::type&)
Unexecuted instantiation: std::__1::__fs::filesystem::path&& std::__1::forward<std::__1::__fs::filesystem::path>(std::__1::remove_reference<std::__1::__fs::filesystem::path>::type&)
Unexecuted instantiation: std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage>&&& std::__1::forward<std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage>&>(std::__1::remove_reference<std::__1::allocator<std::__1::__fs::filesystem::filesystem_error::_Storage>&>::type&)
Unexecuted instantiation: std::__1::__fs::filesystem::path&&&& std::__1::forward<std::__1::__fs::filesystem::path&&>(std::__1::remove_reference<std::__1::__fs::filesystem::path&&>::type&)
Unexecuted instantiation: std::__1::__fs::filesystem::path const&&& std::__1::forward<std::__1::__fs::filesystem::path const&>(std::__1::remove_reference<std::__1::__fs::filesystem::path const&>::type&)
Unexecuted instantiation: std::__1::basic_string_view<char, std::__1::char_traits<char> > const&&& std::__1::forward<std::__1::basic_string_view<char, std::__1::char_traits<char> > const&>(std::__1::remove_reference<std::__1::basic_string_view<char, std::__1::char_traits<char> > const&>::type&)
char const (&&&std::__1::forward<char const (&) [1]>(std::__1::remove_reference<char const (&) [1]>::type&)) [1]
Line
Count
Source
2248
65.1k
{
2249
65.1k
    return static_cast<_Tp&&>(__t);
2250
65.1k
}
Unexecuted instantiation: std::__1::basic_string_view<char, std::__1::char_traits<char> >&& std::__1::forward<std::__1::basic_string_view<char, std::__1::char_traits<char> > >(std::__1::remove_reference<std::__1::basic_string_view<char, std::__1::char_traits<char> > >::type&)
Unexecuted instantiation: std::__1::basic_string_view<char, std::__1::char_traits<char> >&&& std::__1::forward<std::__1::basic_string_view<char, std::__1::char_traits<char> >&>(std::__1::remove_reference<std::__1::basic_string_view<char, std::__1::char_traits<char> >&>::type&)
Unexecuted instantiation: std::__1::__fs::filesystem::PathPartKind&&& std::__1::forward<std::__1::__fs::filesystem::PathPartKind&>(std::__1::remove_reference<std::__1::__fs::filesystem::PathPartKind&>::type&)
Unexecuted instantiation: std::__1::allocator<std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__fs::filesystem::PathPartKind> >&&& std::__1::forward<std::__1::allocator<std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__fs::filesystem::PathPartKind> >&>(std::__1::remove_reference<std::__1::allocator<std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__fs::filesystem::PathPartKind> >&>::type&)
Unexecuted instantiation: std::__1::allocator<std::__1::basic_string_view<char, std::__1::char_traits<char> > >&&& std::__1::forward<std::__1::allocator<std::__1::basic_string_view<char, std::__1::char_traits<char> > >&>(std::__1::remove_reference<std::__1::allocator<std::__1::basic_string_view<char, std::__1::char_traits<char> > >&>::type&)
Unexecuted instantiation: std::__1::allocator<char16_t> const&&& std::__1::forward<std::__1::allocator<char16_t> const&>(std::__1::remove_reference<std::__1::allocator<char16_t> const&>::type&)
Unexecuted instantiation: std::__1::allocator<char32_t> const&&& std::__1::forward<std::__1::allocator<char32_t> const&>(std::__1::remove_reference<std::__1::allocator<char32_t> const&>::type&)
Unexecuted instantiation: operations.cpp:std::__1::__fs::filesystem::__read_symlink(std::__1::__fs::filesystem::path const&, std::__1::error_code*)::NullDeleter&& std::__1::forward<std::__1::__fs::filesystem::__read_symlink(std::__1::__fs::filesystem::path const&, std::__1::error_code*)::NullDeleter>(std::__1::remove_reference<std::__1::__fs::filesystem::__read_symlink(std::__1::__fs::filesystem::path const&, std::__1::error_code*)::NullDeleter>::type&)
Unexecuted instantiation: char (&&&std::__1::forward<char (&) [1024]>(std::__1::remove_reference<char (&) [1024]>::type&)) [1024]
Unexecuted instantiation: std::__1::__fs::filesystem::file_type&& std::__1::forward<std::__1::__fs::filesystem::file_type>(std::__1::remove_reference<std::__1::__fs::filesystem::file_type>::type&)
Unexecuted instantiation: std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::__dir_stream, std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> >*&&& std::__1::forward<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::__dir_stream, std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> >*&>(std::__1::remove_reference<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::__dir_stream, std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> >*&>::type&)
Unexecuted instantiation: std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::__dir_stream, std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> > > >&& std::__1::forward<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::__dir_stream, std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> > > > >(std::__1::remove_reference<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::__dir_stream, std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> > > > >::type&)
Unexecuted instantiation: std::__1::__fs::filesystem::directory_options&&& std::__1::forward<std::__1::__fs::filesystem::directory_options&>(std::__1::remove_reference<std::__1::__fs::filesystem::directory_options&>::type&)
std::__1::error_code&&& std::__1::forward<std::__1::error_code&>(std::__1::remove_reference<std::__1::error_code&>::type&)
Line
Count
Source
2248
3.18M
{
2249
3.18M
    return static_cast<_Tp&&>(__t);
2250
3.18M
}
Unexecuted instantiation: std::__1::allocator<std::__1::__fs::filesystem::__dir_stream>&&& std::__1::forward<std::__1::allocator<std::__1::__fs::filesystem::__dir_stream>&>(std::__1::remove_reference<std::__1::allocator<std::__1::__fs::filesystem::__dir_stream>&>::type&)
Unexecuted instantiation: std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp, std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp> >*&&& std::__1::forward<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp, std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp> >*&>(std::__1::remove_reference<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp, std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp> >*&>::type&)
Unexecuted instantiation: std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp, std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp> > > >&& std::__1::forward<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp, std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp> > > > >(std::__1::remove_reference<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__shared_ptr_emplace<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp, std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp> > > > >::type&)
Unexecuted instantiation: std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp>&& std::__1::forward<std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp> >(std::__1::remove_reference<std::__1::allocator<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp> >::type&)
int&& std::__1::forward<int>(std::__1::remove_reference<int>::type&)
Line
Count
Source
2248
708M
{
2249
708M
    return static_cast<_Tp&&>(__t);
2250
708M
}
Unexecuted instantiation: std::__1::__fs::filesystem::__dir_stream*&& std::__1::forward<std::__1::__fs::filesystem::__dir_stream*>(std::__1::remove_reference<std::__1::__fs::filesystem::__dir_stream*>::type&)
Unexecuted instantiation: std::__1::__fs::filesystem::__dir_stream* const&&& std::__1::forward<std::__1::__fs::filesystem::__dir_stream* const&>(std::__1::remove_reference<std::__1::__fs::filesystem::__dir_stream* const&>::type&)
Unexecuted instantiation: std::__1::allocator<std::__1::__fs::filesystem::__dir_stream*>&&& std::__1::forward<std::__1::allocator<std::__1::__fs::filesystem::__dir_stream*>&>(std::__1::remove_reference<std::__1::allocator<std::__1::__fs::filesystem::__dir_stream*>&>::type&)
Unexecuted instantiation: std::__1::__fs::filesystem::__dir_stream*&&& std::__1::forward<std::__1::__fs::filesystem::__dir_stream*&>(std::__1::remove_reference<std::__1::__fs::filesystem::__dir_stream*&>::type&)
Unexecuted instantiation: std::__1::__allocator_destructor<std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> >&& std::__1::forward<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> > >(std::__1::remove_reference<std::__1::__allocator_destructor<std::__1::allocator<std::__1::__fs::filesystem::__dir_stream> > >::type&)
Unexecuted instantiation: std::__1::__fs::filesystem::__dir_stream&& std::__1::forward<std::__1::__fs::filesystem::__dir_stream>(std::__1::remove_reference<std::__1::__fs::filesystem::__dir_stream>::type&)
2251
2252
template <class _Tp>
2253
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
2254
_Tp&&
2255
forward(typename remove_reference<_Tp>::type&& __t) _NOEXCEPT
2256
{
2257
    static_assert(!is_lvalue_reference<_Tp>::value,
2258
                  "can not forward an rvalue as an lvalue");
2259
    return static_cast<_Tp&&>(__t);
2260
}
2261
2262
template <class _Tp>
2263
inline _LIBCPP_INLINE_VISIBILITY
2264
typename decay<_Tp>::type
2265
__decay_copy(_Tp&& __t)
2266
{
2267
    return _VSTD::forward<_Tp>(__t);
2268
}
2269
2270
template <class _MP, bool _IsMemberFunctionPtr, bool _IsMemberObjectPtr>
2271
struct __member_pointer_traits_imp
2272
{
2273
};
2274
2275
template <class _Rp, class _Class, class ..._Param>
2276
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false>
2277
{
2278
    typedef _Class _ClassType;
2279
    typedef _Rp _ReturnType;
2280
    typedef _Rp (_FnType) (_Param...);
2281
};
2282
2283
template <class _Rp, class _Class, class ..._Param>
2284
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...), true, false>
2285
{
2286
    typedef _Class _ClassType;
2287
    typedef _Rp _ReturnType;
2288
    typedef _Rp (_FnType) (_Param..., ...);
2289
};
2290
2291
template <class _Rp, class _Class, class ..._Param>
2292
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const, true, false>
2293
{
2294
    typedef _Class const _ClassType;
2295
    typedef _Rp _ReturnType;
2296
    typedef _Rp (_FnType) (_Param...);
2297
};
2298
2299
template <class _Rp, class _Class, class ..._Param>
2300
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const, true, false>
2301
{
2302
    typedef _Class const _ClassType;
2303
    typedef _Rp _ReturnType;
2304
    typedef _Rp (_FnType) (_Param..., ...);
2305
};
2306
2307
template <class _Rp, class _Class, class ..._Param>
2308
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile, true, false>
2309
{
2310
    typedef _Class volatile _ClassType;
2311
    typedef _Rp _ReturnType;
2312
    typedef _Rp (_FnType) (_Param...);
2313
};
2314
2315
template <class _Rp, class _Class, class ..._Param>
2316
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile, true, false>
2317
{
2318
    typedef _Class volatile _ClassType;
2319
    typedef _Rp _ReturnType;
2320
    typedef _Rp (_FnType) (_Param..., ...);
2321
};
2322
2323
template <class _Rp, class _Class, class ..._Param>
2324
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile, true, false>
2325
{
2326
    typedef _Class const volatile _ClassType;
2327
    typedef _Rp _ReturnType;
2328
    typedef _Rp (_FnType) (_Param...);
2329
};
2330
2331
template <class _Rp, class _Class, class ..._Param>
2332
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile, true, false>
2333
{
2334
    typedef _Class const volatile _ClassType;
2335
    typedef _Rp _ReturnType;
2336
    typedef _Rp (_FnType) (_Param..., ...);
2337
};
2338
2339
#if __has_feature(cxx_reference_qualified_functions) || defined(_LIBCPP_COMPILER_GCC)
2340
2341
template <class _Rp, class _Class, class ..._Param>
2342
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &, true, false>
2343
{
2344
    typedef _Class& _ClassType;
2345
    typedef _Rp _ReturnType;
2346
    typedef _Rp (_FnType) (_Param...);
2347
};
2348
2349
template <class _Rp, class _Class, class ..._Param>
2350
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) &, true, false>
2351
{
2352
    typedef _Class& _ClassType;
2353
    typedef _Rp _ReturnType;
2354
    typedef _Rp (_FnType) (_Param..., ...);
2355
};
2356
2357
template <class _Rp, class _Class, class ..._Param>
2358
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&, true, false>
2359
{
2360
    typedef _Class const& _ClassType;
2361
    typedef _Rp _ReturnType;
2362
    typedef _Rp (_FnType) (_Param...);
2363
};
2364
2365
template <class _Rp, class _Class, class ..._Param>
2366
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const&, true, false>
2367
{
2368
    typedef _Class const& _ClassType;
2369
    typedef _Rp _ReturnType;
2370
    typedef _Rp (_FnType) (_Param..., ...);
2371
};
2372
2373
template <class _Rp, class _Class, class ..._Param>
2374
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&, true, false>
2375
{
2376
    typedef _Class volatile& _ClassType;
2377
    typedef _Rp _ReturnType;
2378
    typedef _Rp (_FnType) (_Param...);
2379
};
2380
2381
template <class _Rp, class _Class, class ..._Param>
2382
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile&, true, false>
2383
{
2384
    typedef _Class volatile& _ClassType;
2385
    typedef _Rp _ReturnType;
2386
    typedef _Rp (_FnType) (_Param..., ...);
2387
};
2388
2389
template <class _Rp, class _Class, class ..._Param>
2390
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&, true, false>
2391
{
2392
    typedef _Class const volatile& _ClassType;
2393
    typedef _Rp _ReturnType;
2394
    typedef _Rp (_FnType) (_Param...);
2395
};
2396
2397
template <class _Rp, class _Class, class ..._Param>
2398
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile&, true, false>
2399
{
2400
    typedef _Class const volatile& _ClassType;
2401
    typedef _Rp _ReturnType;
2402
    typedef _Rp (_FnType) (_Param..., ...);
2403
};
2404
2405
template <class _Rp, class _Class, class ..._Param>
2406
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &&, true, false>
2407
{
2408
    typedef _Class&& _ClassType;
2409
    typedef _Rp _ReturnType;
2410
    typedef _Rp (_FnType) (_Param...);
2411
};
2412
2413
template <class _Rp, class _Class, class ..._Param>
2414
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) &&, true, false>
2415
{
2416
    typedef _Class&& _ClassType;
2417
    typedef _Rp _ReturnType;
2418
    typedef _Rp (_FnType) (_Param..., ...);
2419
};
2420
2421
template <class _Rp, class _Class, class ..._Param>
2422
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&&, true, false>
2423
{
2424
    typedef _Class const&& _ClassType;
2425
    typedef _Rp _ReturnType;
2426
    typedef _Rp (_FnType) (_Param...);
2427
};
2428
2429
template <class _Rp, class _Class, class ..._Param>
2430
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const&&, true, false>
2431
{
2432
    typedef _Class const&& _ClassType;
2433
    typedef _Rp _ReturnType;
2434
    typedef _Rp (_FnType) (_Param..., ...);
2435
};
2436
2437
template <class _Rp, class _Class, class ..._Param>
2438
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&&, true, false>
2439
{
2440
    typedef _Class volatile&& _ClassType;
2441
    typedef _Rp _ReturnType;
2442
    typedef _Rp (_FnType) (_Param...);
2443
};
2444
2445
template <class _Rp, class _Class, class ..._Param>
2446
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile&&, true, false>
2447
{
2448
    typedef _Class volatile&& _ClassType;
2449
    typedef _Rp _ReturnType;
2450
    typedef _Rp (_FnType) (_Param..., ...);
2451
};
2452
2453
template <class _Rp, class _Class, class ..._Param>
2454
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&&, true, false>
2455
{
2456
    typedef _Class const volatile&& _ClassType;
2457
    typedef _Rp _ReturnType;
2458
    typedef _Rp (_FnType) (_Param...);
2459
};
2460
2461
template <class _Rp, class _Class, class ..._Param>
2462
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile&&, true, false>
2463
{
2464
    typedef _Class const volatile&& _ClassType;
2465
    typedef _Rp _ReturnType;
2466
    typedef _Rp (_FnType) (_Param..., ...);
2467
};
2468
2469
#endif  // __has_feature(cxx_reference_qualified_functions) || defined(_LIBCPP_COMPILER_GCC)
2470
2471
2472
template <class _Rp, class _Class>
2473
struct __member_pointer_traits_imp<_Rp _Class::*, false, true>
2474
{
2475
    typedef _Class _ClassType;
2476
    typedef _Rp _ReturnType;
2477
};
2478
2479
template <class _MP>
2480
struct __member_pointer_traits
2481
    : public __member_pointer_traits_imp<typename remove_cv<_MP>::type,
2482
                    is_member_function_pointer<_MP>::value,
2483
                    is_member_object_pointer<_MP>::value>
2484
{
2485
//     typedef ... _ClassType;
2486
//     typedef ... _ReturnType;
2487
//     typedef ... _FnType;
2488
};
2489
2490
2491
template <class _DecayedFp>
2492
struct __member_pointer_class_type {};
2493
2494
template <class _Ret, class _ClassType>
2495
struct __member_pointer_class_type<_Ret _ClassType::*> {
2496
  typedef _ClassType type;
2497
};
2498
2499
// result_of
2500
2501
template <class _Callable> class result_of;
2502
2503
#ifdef _LIBCPP_HAS_NO_VARIADICS
2504
2505
template <class _Fn, bool, bool>
2506
class __result_of
2507
{
2508
};
2509
2510
template <class _Fn>
2511
class __result_of<_Fn(), true, false>
2512
{
2513
public:
2514
    typedef decltype(declval<_Fn>()()) type;
2515
};
2516
2517
template <class _Fn, class _A0>
2518
class __result_of<_Fn(_A0), true, false>
2519
{
2520
public:
2521
    typedef decltype(declval<_Fn>()(declval<_A0>())) type;
2522
};
2523
2524
template <class _Fn, class _A0, class _A1>
2525
class __result_of<_Fn(_A0, _A1), true, false>
2526
{
2527
public:
2528
    typedef decltype(declval<_Fn>()(declval<_A0>(), declval<_A1>())) type;
2529
};
2530
2531
template <class _Fn, class _A0, class _A1, class _A2>
2532
class __result_of<_Fn(_A0, _A1, _A2), true, false>
2533
{
2534
public:
2535
    typedef decltype(declval<_Fn>()(declval<_A0>(), declval<_A1>(), declval<_A2>())) type;
2536
};
2537
2538
template <class _MP, class _Tp, bool _IsMemberFunctionPtr>
2539
struct __result_of_mp;
2540
2541
// member function pointer
2542
2543
template <class _MP, class _Tp>
2544
struct __result_of_mp<_MP, _Tp, true>
2545
    : public __identity<typename __member_pointer_traits<_MP>::_ReturnType>
2546
{
2547
};
2548
2549
// member data pointer
2550
2551
template <class _MP, class _Tp, bool>
2552
struct __result_of_mdp;
2553
2554
template <class _Rp, class _Class, class _Tp>
2555
struct __result_of_mdp<_Rp _Class::*, _Tp, false>
2556
{
2557
    typedef typename __apply_cv<decltype(*_VSTD::declval<_Tp>()), _Rp>::type& type;
2558
};
2559
2560
template <class _Rp, class _Class, class _Tp>
2561
struct __result_of_mdp<_Rp _Class::*, _Tp, true>
2562
{
2563
    typedef typename __apply_cv<_Tp, _Rp>::type& type;
2564
};
2565
2566
template <class _Rp, class _Class, class _Tp>
2567
struct __result_of_mp<_Rp _Class::*, _Tp, false>
2568
    : public __result_of_mdp<_Rp _Class::*, _Tp,
2569
            is_base_of<_Class, typename remove_reference<_Tp>::type>::value>
2570
{
2571
};
2572
2573
2574
2575
template <class _Fn, class _Tp>
2576
class __result_of<_Fn(_Tp), false, true>  // _Fn must be member pointer
2577
    : public __result_of_mp<typename remove_reference<_Fn>::type,
2578
                            _Tp,
2579
                            is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
2580
{
2581
};
2582
2583
template <class _Fn, class _Tp, class _A0>
2584
class __result_of<_Fn(_Tp, _A0), false, true>  // _Fn must be member pointer
2585
    : public __result_of_mp<typename remove_reference<_Fn>::type,
2586
                            _Tp,
2587
                            is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
2588
{
2589
};
2590
2591
template <class _Fn, class _Tp, class _A0, class _A1>
2592
class __result_of<_Fn(_Tp, _A0, _A1), false, true>  // _Fn must be member pointer
2593
    : public __result_of_mp<typename remove_reference<_Fn>::type,
2594
                            _Tp,
2595
                            is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
2596
{
2597
};
2598
2599
template <class _Fn, class _Tp, class _A0, class _A1, class _A2>
2600
class __result_of<_Fn(_Tp, _A0, _A1, _A2), false, true>  // _Fn must be member pointer
2601
    : public __result_of_mp<typename remove_reference<_Fn>::type,
2602
                            _Tp,
2603
                            is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
2604
{
2605
};
2606
2607
// result_of
2608
2609
template <class _Fn>
2610
class _LIBCPP_TEMPLATE_VIS result_of<_Fn()>
2611
    : public __result_of<_Fn(),
2612
                         is_class<typename remove_reference<_Fn>::type>::value ||
2613
                         is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
2614
                         is_member_pointer<typename remove_reference<_Fn>::type>::value
2615
                        >
2616
{
2617
};
2618
2619
template <class _Fn, class _A0>
2620
class _LIBCPP_TEMPLATE_VIS result_of<_Fn(_A0)>
2621
    : public __result_of<_Fn(_A0),
2622
                         is_class<typename remove_reference<_Fn>::type>::value ||
2623
                         is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
2624
                         is_member_pointer<typename remove_reference<_Fn>::type>::value
2625
                        >
2626
{
2627
};
2628
2629
template <class _Fn, class _A0, class _A1>
2630
class _LIBCPP_TEMPLATE_VIS result_of<_Fn(_A0, _A1)>
2631
    : public __result_of<_Fn(_A0, _A1),
2632
                         is_class<typename remove_reference<_Fn>::type>::value ||
2633
                         is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
2634
                         is_member_pointer<typename remove_reference<_Fn>::type>::value
2635
                        >
2636
{
2637
};
2638
2639
template <class _Fn, class _A0, class _A1, class _A2>
2640
class _LIBCPP_TEMPLATE_VIS result_of<_Fn(_A0, _A1, _A2)>
2641
    : public __result_of<_Fn(_A0, _A1, _A2),
2642
                         is_class<typename remove_reference<_Fn>::type>::value ||
2643
                         is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
2644
                         is_member_pointer<typename remove_reference<_Fn>::type>::value
2645
                        >
2646
{
2647
};
2648
2649
#endif  // _LIBCPP_HAS_NO_VARIADICS
2650
2651
// template <class T, class... Args> struct is_constructible;
2652
2653
namespace __is_construct
2654
{
2655
struct __nat {};
2656
}
2657
2658
#if !defined(_LIBCPP_CXX03_LANG) && (!__has_feature(is_constructible) || \
2659
    defined(_LIBCPP_TESTING_FALLBACK_IS_CONSTRUCTIBLE))
2660
2661
template <class _Tp, class... _Args>
2662
struct __libcpp_is_constructible;
2663
2664
template <class _To, class _From>
2665
struct __is_invalid_base_to_derived_cast {
2666
  static_assert(is_reference<_To>::value, "Wrong specialization");
2667
  using _RawFrom = __uncvref_t<_From>;
2668
  using _RawTo = __uncvref_t<_To>;
2669
  static const bool value = _And<
2670
        _IsNotSame<_RawFrom, _RawTo>,
2671
        is_base_of<_RawFrom, _RawTo>,
2672
        _Not<__libcpp_is_constructible<_RawTo, _From>>
2673
  >::value;
2674
};
2675
2676
template <class _To, class _From>
2677
struct __is_invalid_lvalue_to_rvalue_cast : false_type {
2678
  static_assert(is_reference<_To>::value, "Wrong specialization");
2679
};
2680
2681
template <class _ToRef, class _FromRef>
2682
struct __is_invalid_lvalue_to_rvalue_cast<_ToRef&&, _FromRef&> {
2683
  using _RawFrom = __uncvref_t<_FromRef>;
2684
  using _RawTo = __uncvref_t<_ToRef>;
2685
  static const bool value = _And<
2686
      _Not<is_function<_RawTo>>,
2687
      _Or<
2688
        _IsSame<_RawFrom, _RawTo>,
2689
        is_base_of<_RawTo, _RawFrom>>
2690
    >::value;
2691
};
2692
2693
struct __is_constructible_helper
2694
{
2695
    template <class _To>
2696
    static void __eat(_To);
2697
2698
    // This overload is needed to work around a Clang bug that disallows
2699
    // static_cast<T&&>(e) for non-reference-compatible types.
2700
    // Example: static_cast<int&&>(declval<double>());
2701
    // NOTE: The static_cast implementation below is required to support
2702
    //  classes with explicit conversion operators.
2703
    template <class _To, class _From,
2704
              class = decltype(__eat<_To>(_VSTD::declval<_From>()))>
2705
    static true_type __test_cast(int);
2706
2707
    template <class _To, class _From,
2708
              class = decltype(static_cast<_To>(_VSTD::declval<_From>()))>
2709
    static integral_constant<bool,
2710
        !__is_invalid_base_to_derived_cast<_To, _From>::value &&
2711
        !__is_invalid_lvalue_to_rvalue_cast<_To, _From>::value
2712
    > __test_cast(long);
2713
2714
    template <class, class>
2715
    static false_type __test_cast(...);
2716
2717
    template <class _Tp, class ..._Args,
2718
        class = decltype(_Tp(_VSTD::declval<_Args>()...))>
2719
    static true_type __test_nary(int);
2720
    template <class _Tp, class...>
2721
    static false_type __test_nary(...);
2722
2723
    template <class _Tp, class _A0, class = decltype(::new _Tp(_VSTD::declval<_A0>()))>
2724
    static is_destructible<_Tp> __test_unary(int);
2725
    template <class, class>
2726
    static false_type __test_unary(...);
2727
};
2728
2729
template <class _Tp, bool = is_void<_Tp>::value>
2730
struct __is_default_constructible
2731
    : decltype(__is_constructible_helper::__test_nary<_Tp>(0))
2732
{};
2733
2734
template <class _Tp>
2735
struct __is_default_constructible<_Tp, true> : false_type {};
2736
2737
template <class _Tp>
2738
struct __is_default_constructible<_Tp[], false> : false_type {};
2739
2740
template <class _Tp, size_t _Nx>
2741
struct __is_default_constructible<_Tp[_Nx], false>
2742
    : __is_default_constructible<typename remove_all_extents<_Tp>::type>  {};
2743
2744
template <class _Tp, class... _Args>
2745
struct __libcpp_is_constructible
2746
{
2747
  static_assert(sizeof...(_Args) > 1, "Wrong specialization");
2748
  typedef decltype(__is_constructible_helper::__test_nary<_Tp, _Args...>(0))
2749
      type;
2750
};
2751
2752
template <class _Tp>
2753
struct __libcpp_is_constructible<_Tp> : __is_default_constructible<_Tp> {};
2754
2755
template <class _Tp, class _A0>
2756
struct __libcpp_is_constructible<_Tp, _A0>
2757
    : public decltype(__is_constructible_helper::__test_unary<_Tp, _A0>(0))
2758
{};
2759
2760
template <class _Tp, class _A0>
2761
struct __libcpp_is_constructible<_Tp&, _A0>
2762
    : public decltype(__is_constructible_helper::
2763
    __test_cast<_Tp&, _A0>(0))
2764
{};
2765
2766
template <class _Tp, class _A0>
2767
struct __libcpp_is_constructible<_Tp&&, _A0>
2768
    : public decltype(__is_constructible_helper::
2769
    __test_cast<_Tp&&, _A0>(0))
2770
{};
2771
2772
#endif
2773
2774
#if __has_feature(is_constructible)
2775
template <class _Tp, class ..._Args>
2776
struct _LIBCPP_TEMPLATE_VIS is_constructible
2777
    : public integral_constant<bool, __is_constructible(_Tp, _Args...)>
2778
    {};
2779
#else
2780
template <class _Tp, class... _Args>
2781
struct _LIBCPP_TEMPLATE_VIS is_constructible
2782
    : public __libcpp_is_constructible<_Tp, _Args...>::type {};
2783
#endif
2784
2785
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
2786
template <class _Tp, class ..._Args>
2787
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_constructible_v
2788
    = is_constructible<_Tp, _Args...>::value;
2789
#endif
2790
2791
// is_default_constructible
2792
2793
template <class _Tp>
2794
struct _LIBCPP_TEMPLATE_VIS is_default_constructible
2795
    : public is_constructible<_Tp>
2796
    {};
2797
2798
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
2799
template <class _Tp>
2800
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_default_constructible_v
2801
    = is_default_constructible<_Tp>::value;
2802
#endif
2803
2804
#ifndef _LIBCPP_CXX03_LANG
2805
// First of all, we can't implement this check in C++03 mode because the {}
2806
// default initialization syntax isn't valid.
2807
// Second, we implement the trait in a funny manner with two defaulted template
2808
// arguments to workaround Clang's PR43454.
2809
template <class _Tp>
2810
void __test_implicit_default_constructible(_Tp);
2811
2812
template <class _Tp, class = void, bool = is_default_constructible<_Tp>::value>
2813
struct __is_implicitly_default_constructible
2814
    : false_type
2815
{ };
2816
2817
template <class _Tp>
2818
struct __is_implicitly_default_constructible<_Tp, decltype(__test_implicit_default_constructible<_Tp const&>({})), true>
2819
    : true_type
2820
{ };
2821
2822
template <class _Tp>
2823
struct __is_implicitly_default_constructible<_Tp, decltype(__test_implicit_default_constructible<_Tp const&>({})), false>
2824
    : false_type
2825
{ };
2826
#endif // !C++03
2827
2828
// is_copy_constructible
2829
2830
template <class _Tp>
2831
struct _LIBCPP_TEMPLATE_VIS is_copy_constructible
2832
    : public is_constructible<_Tp,
2833
                  typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
2834
2835
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
2836
template <class _Tp>
2837
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_copy_constructible_v
2838
    = is_copy_constructible<_Tp>::value;
2839
#endif
2840
2841
// is_move_constructible
2842
2843
template <class _Tp>
2844
struct _LIBCPP_TEMPLATE_VIS is_move_constructible
2845
    : public is_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
2846
    {};
2847
2848
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
2849
template <class _Tp>
2850
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_move_constructible_v
2851
    = is_move_constructible<_Tp>::value;
2852
#endif
2853
2854
// is_trivially_constructible
2855
2856
#if __has_feature(is_trivially_constructible) || _GNUC_VER >= 501
2857
2858
template <class _Tp, class... _Args>
2859
struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible
2860
    : integral_constant<bool, __is_trivially_constructible(_Tp, _Args...)>
2861
{
2862
};
2863
2864
#else  // !__has_feature(is_trivially_constructible)
2865
2866
template <class _Tp, class... _Args>
2867
struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible
2868
    : false_type
2869
{
2870
};
2871
2872
template <class _Tp>
2873
struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp>
2874
#if __has_feature(has_trivial_constructor) || defined(_LIBCPP_COMPILER_GCC)
2875
    : integral_constant<bool, __has_trivial_constructor(_Tp)>
2876
#else
2877
    : integral_constant<bool, is_scalar<_Tp>::value>
2878
#endif
2879
{
2880
};
2881
2882
template <class _Tp>
2883
struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&&>
2884
    : integral_constant<bool, is_scalar<_Tp>::value>
2885
{
2886
};
2887
2888
template <class _Tp>
2889
struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, const _Tp&>
2890
    : integral_constant<bool, is_scalar<_Tp>::value>
2891
{
2892
};
2893
2894
template <class _Tp>
2895
struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&>
2896
    : integral_constant<bool, is_scalar<_Tp>::value>
2897
{
2898
};
2899
2900
#endif  // !__has_feature(is_trivially_constructible)
2901
2902
2903
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
2904
template <class _Tp, class... _Args>
2905
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_constructible_v
2906
    = is_trivially_constructible<_Tp, _Args...>::value;
2907
#endif
2908
2909
// is_trivially_default_constructible
2910
2911
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_default_constructible
2912
    : public is_trivially_constructible<_Tp>
2913
    {};
2914
2915
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
2916
template <class _Tp>
2917
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_default_constructible_v
2918
    = is_trivially_default_constructible<_Tp>::value;
2919
#endif
2920
2921
// is_trivially_copy_constructible
2922
2923
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_constructible
2924
    : public is_trivially_constructible<_Tp, typename add_lvalue_reference<const _Tp>::type>
2925
    {};
2926
2927
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
2928
template <class _Tp>
2929
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_copy_constructible_v
2930
    = is_trivially_copy_constructible<_Tp>::value;
2931
#endif
2932
2933
// is_trivially_move_constructible
2934
2935
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_move_constructible
2936
    : public is_trivially_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
2937
    {};
2938
2939
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
2940
template <class _Tp>
2941
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_move_constructible_v
2942
    = is_trivially_move_constructible<_Tp>::value;
2943
#endif
2944
2945
// is_trivially_assignable
2946
2947
#if __has_feature(is_trivially_assignable) || _GNUC_VER >= 501
2948
2949
template <class _Tp, class _Arg>
2950
struct is_trivially_assignable
2951
    : integral_constant<bool, __is_trivially_assignable(_Tp, _Arg)>
2952
{
2953
};
2954
2955
#else  // !__has_feature(is_trivially_assignable)
2956
2957
template <class _Tp, class _Arg>
2958
struct is_trivially_assignable
2959
    : public false_type {};
2960
2961
template <class _Tp>
2962
struct is_trivially_assignable<_Tp&, _Tp>
2963
    : integral_constant<bool, is_scalar<_Tp>::value> {};
2964
2965
template <class _Tp>
2966
struct is_trivially_assignable<_Tp&, _Tp&>
2967
    : integral_constant<bool, is_scalar<_Tp>::value> {};
2968
2969
template <class _Tp>
2970
struct is_trivially_assignable<_Tp&, const _Tp&>
2971
    : integral_constant<bool, is_scalar<_Tp>::value> {};
2972
2973
template <class _Tp>
2974
struct is_trivially_assignable<_Tp&, _Tp&&>
2975
    : integral_constant<bool, is_scalar<_Tp>::value> {};
2976
2977
#endif  // !__has_feature(is_trivially_assignable)
2978
2979
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
2980
template <class _Tp, class _Arg>
2981
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_assignable_v
2982
    = is_trivially_assignable<_Tp, _Arg>::value;
2983
#endif
2984
2985
// is_trivially_copy_assignable
2986
2987
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_assignable
2988
    : public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
2989
                  typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
2990
2991
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
2992
template <class _Tp>
2993
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_copy_assignable_v
2994
    = is_trivially_copy_assignable<_Tp>::value;
2995
#endif
2996
2997
// is_trivially_move_assignable
2998
2999
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_move_assignable
3000
    : public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
3001
                                     typename add_rvalue_reference<_Tp>::type>
3002
    {};
3003
3004
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
3005
template <class _Tp>
3006
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_move_assignable_v
3007
    = is_trivially_move_assignable<_Tp>::value;
3008
#endif
3009
3010
// is_trivially_destructible
3011
3012
#if __has_keyword(__is_trivially_destructible)
3013
3014
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible
3015
    : public integral_constant<bool, __is_trivially_destructible(_Tp)> {};
3016
3017
#elif __has_feature(has_trivial_destructor) || defined(_LIBCPP_COMPILER_GCC)
3018
3019
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible
3020
    : public integral_constant<bool, is_destructible<_Tp>::value && __has_trivial_destructor(_Tp)> {};
3021
3022
#else
3023
3024
template <class _Tp> struct __libcpp_trivial_destructor
3025
    : public integral_constant<bool, is_scalar<_Tp>::value ||
3026
                                     is_reference<_Tp>::value> {};
3027
3028
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible
3029
    : public __libcpp_trivial_destructor<typename remove_all_extents<_Tp>::type> {};
3030
3031
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible<_Tp[]>
3032
    : public false_type {};
3033
3034
#endif
3035
3036
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
3037
template <class _Tp>
3038
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_destructible_v
3039
    = is_trivially_destructible<_Tp>::value;
3040
#endif
3041
3042
// is_nothrow_constructible
3043
3044
#if __has_keyword(__is_nothrow_constructible)
3045
3046
template <class _Tp, class... _Args>
3047
struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible
3048
    : public integral_constant<bool, __is_nothrow_constructible(_Tp, _Args...)> {};
3049
3050
#else
3051
3052
template <bool, bool, class _Tp, class... _Args> struct __libcpp_is_nothrow_constructible;
3053
3054
template <class _Tp, class... _Args>
3055
struct __libcpp_is_nothrow_constructible</*is constructible*/true, /*is reference*/false, _Tp, _Args...>
3056
    : public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))>
3057
{
3058
};
3059
3060
template <class _Tp>
3061
void __implicit_conversion_to(_Tp) noexcept { }
3062
3063
template <class _Tp, class _Arg>
3064
struct __libcpp_is_nothrow_constructible</*is constructible*/true, /*is reference*/true, _Tp, _Arg>
3065
    : public integral_constant<bool, noexcept(__implicit_conversion_to<_Tp>(declval<_Arg>()))>
3066
{
3067
};
3068
3069
template <class _Tp, bool _IsReference, class... _Args>
3070
struct __libcpp_is_nothrow_constructible</*is constructible*/false, _IsReference, _Tp, _Args...>
3071
    : public false_type
3072
{
3073
};
3074
3075
template <class _Tp, class... _Args>
3076
struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible
3077
    : __libcpp_is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, is_reference<_Tp>::value, _Tp, _Args...>
3078
{
3079
};
3080
3081
template <class _Tp, size_t _Ns>
3082
struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp[_Ns]>
3083
    : __libcpp_is_nothrow_constructible<is_constructible<_Tp>::value, is_reference<_Tp>::value, _Tp>
3084
{
3085
};
3086
3087
#endif  // _LIBCPP_HAS_NO_NOEXCEPT
3088
3089
3090
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
3091
template <class _Tp, class ..._Args>
3092
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_constructible_v
3093
    = is_nothrow_constructible<_Tp, _Args...>::value;
3094
#endif
3095
3096
// is_nothrow_default_constructible
3097
3098
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_default_constructible
3099
    : public is_nothrow_constructible<_Tp>
3100
    {};
3101
3102
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
3103
template <class _Tp>
3104
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_default_constructible_v
3105
    = is_nothrow_default_constructible<_Tp>::value;
3106
#endif
3107
3108
// is_nothrow_copy_constructible
3109
3110
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_constructible
3111
    : public is_nothrow_constructible<_Tp,
3112
                  typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
3113
3114
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
3115
template <class _Tp>
3116
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_copy_constructible_v
3117
    = is_nothrow_copy_constructible<_Tp>::value;
3118
#endif
3119
3120
// is_nothrow_move_constructible
3121
3122
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible
3123
    : public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
3124
    {};
3125
3126
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
3127
template <class _Tp>
3128
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_move_constructible_v
3129
    = is_nothrow_move_constructible<_Tp>::value;
3130
#endif
3131
3132
// is_nothrow_assignable
3133
3134
#if __has_keyword(__is_nothrow_assignable)
3135
3136
template <class _Tp, class _Arg>
3137
struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable
3138
    : public integral_constant<bool, __is_nothrow_assignable(_Tp, _Arg)> {};
3139
3140
#else
3141
3142
template <bool, class _Tp, class _Arg> struct __libcpp_is_nothrow_assignable;
3143
3144
template <class _Tp, class _Arg>
3145
struct __libcpp_is_nothrow_assignable<false, _Tp, _Arg>
3146
    : public false_type
3147
{
3148
};
3149
3150
template <class _Tp, class _Arg>
3151
struct __libcpp_is_nothrow_assignable<true, _Tp, _Arg>
3152
    : public integral_constant<bool, noexcept(_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>()) >
3153
{
3154
};
3155
3156
template <class _Tp, class _Arg>
3157
struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable
3158
    : public __libcpp_is_nothrow_assignable<is_assignable<_Tp, _Arg>::value, _Tp, _Arg>
3159
{
3160
};
3161
3162
#endif  // _LIBCPP_HAS_NO_NOEXCEPT
3163
3164
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
3165
template <class _Tp, class _Arg>
3166
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_assignable_v
3167
    = is_nothrow_assignable<_Tp, _Arg>::value;
3168
#endif
3169
3170
// is_nothrow_copy_assignable
3171
3172
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_assignable
3173
    : public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
3174
                  typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
3175
3176
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
3177
template <class _Tp>
3178
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_copy_assignable_v
3179
    = is_nothrow_copy_assignable<_Tp>::value;
3180
#endif
3181
3182
// is_nothrow_move_assignable
3183
3184
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_assignable
3185
    : public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
3186
                                     typename add_rvalue_reference<_Tp>::type>
3187
    {};
3188
3189
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
3190
template <class _Tp>
3191
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_move_assignable_v
3192
    = is_nothrow_move_assignable<_Tp>::value;
3193
#endif
3194
3195
// is_nothrow_destructible
3196
3197
#if !defined(_LIBCPP_CXX03_LANG)
3198
3199
template <bool, class _Tp> struct __libcpp_is_nothrow_destructible;
3200
3201
template <class _Tp>
3202
struct __libcpp_is_nothrow_destructible<false, _Tp>
3203
    : public false_type
3204
{
3205
};
3206
3207
template <class _Tp>
3208
struct __libcpp_is_nothrow_destructible<true, _Tp>
3209
    : public integral_constant<bool, noexcept(_VSTD::declval<_Tp>().~_Tp()) >
3210
{
3211
};
3212
3213
template <class _Tp>
3214
struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible
3215
    : public __libcpp_is_nothrow_destructible<is_destructible<_Tp>::value, _Tp>
3216
{
3217
};
3218
3219
template <class _Tp, size_t _Ns>
3220
struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[_Ns]>
3221
    : public is_nothrow_destructible<_Tp>
3222
{
3223
};
3224
3225
template <class _Tp>
3226
struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&>
3227
    : public true_type
3228
{
3229
};
3230
3231
template <class _Tp>
3232
struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&&>
3233
    : public true_type
3234
{
3235
};
3236
3237
#else
3238
3239
template <class _Tp> struct __libcpp_nothrow_destructor
3240
    : public integral_constant<bool, is_scalar<_Tp>::value ||
3241
                                     is_reference<_Tp>::value> {};
3242
3243
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible
3244
    : public __libcpp_nothrow_destructor<typename remove_all_extents<_Tp>::type> {};
3245
3246
template <class _Tp>
3247
struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[]>
3248
    : public false_type {};
3249
3250
#endif
3251
3252
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
3253
template <class _Tp>
3254
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_destructible_v
3255
    = is_nothrow_destructible<_Tp>::value;
3256
#endif
3257
3258
// is_pod
3259
3260
#if __has_feature(is_pod) || defined(_LIBCPP_COMPILER_GCC)
3261
3262
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pod
3263
    : public integral_constant<bool, __is_pod(_Tp)> {};
3264
3265
#else
3266
3267
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pod
3268
    : public integral_constant<bool, is_trivially_default_constructible<_Tp>::value   &&
3269
                                     is_trivially_copy_constructible<_Tp>::value      &&
3270
                                     is_trivially_copy_assignable<_Tp>::value    &&
3271
                                     is_trivially_destructible<_Tp>::value> {};
3272
3273
#endif
3274
3275
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
3276
template <class _Tp>
3277
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_pod_v
3278
    = is_pod<_Tp>::value;
3279
#endif
3280
3281
// is_literal_type;
3282
3283
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_literal_type
3284
    : public integral_constant<bool, __is_literal_type(_Tp)>
3285
    {};
3286
3287
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
3288
template <class _Tp>
3289
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_literal_type_v
3290
    = is_literal_type<_Tp>::value;
3291
#endif
3292
3293
// is_standard_layout;
3294
3295
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_standard_layout
3296
#if __has_feature(is_standard_layout) || defined(_LIBCPP_COMPILER_GCC)
3297
    : public integral_constant<bool, __is_standard_layout(_Tp)>
3298
#else
3299
    : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value>
3300
#endif
3301
    {};
3302
3303
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
3304
template <class _Tp>
3305
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_standard_layout_v
3306
    = is_standard_layout<_Tp>::value;
3307
#endif
3308
3309
// is_trivially_copyable;
3310
3311
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copyable
3312
#if __has_feature(is_trivially_copyable)
3313
    : public integral_constant<bool, __is_trivially_copyable(_Tp)>
3314
#elif _GNUC_VER >= 501
3315
    : public integral_constant<bool, !is_volatile<_Tp>::value && __is_trivially_copyable(_Tp)>
3316
#else
3317
    : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value>
3318
#endif
3319
    {};
3320
3321
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
3322
template <class _Tp>
3323
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_copyable_v
3324
    = is_trivially_copyable<_Tp>::value;
3325
#endif
3326
3327
// is_trivial;
3328
3329
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivial
3330
#if __has_feature(is_trivial) || defined(_LIBCPP_COMPILER_GCC)
3331
    : public integral_constant<bool, __is_trivial(_Tp)>
3332
#else
3333
    : integral_constant<bool, is_trivially_copyable<_Tp>::value &&
3334
                                 is_trivially_default_constructible<_Tp>::value>
3335
#endif
3336
    {};
3337
3338
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
3339
template <class _Tp>
3340
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivial_v
3341
    = is_trivial<_Tp>::value;
3342
#endif
3343
3344
template <class _Tp> struct __is_reference_wrapper_impl : public false_type {};
3345
template <class _Tp> struct __is_reference_wrapper_impl<reference_wrapper<_Tp> > : public true_type {};
3346
template <class _Tp> struct __is_reference_wrapper
3347
    : public __is_reference_wrapper_impl<typename remove_cv<_Tp>::type> {};
3348
3349
#ifndef _LIBCPP_CXX03_LANG
3350
3351
template <class _Fp, class _A0,
3352
         class _DecayFp = typename decay<_Fp>::type,
3353
         class _DecayA0 = typename decay<_A0>::type,
3354
         class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
3355
using __enable_if_bullet1 = typename enable_if
3356
    <
3357
        is_member_function_pointer<_DecayFp>::value
3358
        && is_base_of<_ClassT, _DecayA0>::value
3359
    >::type;
3360
3361
template <class _Fp, class _A0,
3362
         class _DecayFp = typename decay<_Fp>::type,
3363
         class _DecayA0 = typename decay<_A0>::type>
3364
using __enable_if_bullet2 = typename enable_if
3365
    <
3366
        is_member_function_pointer<_DecayFp>::value
3367
        && __is_reference_wrapper<_DecayA0>::value
3368
    >::type;
3369
3370
template <class _Fp, class _A0,
3371
         class _DecayFp = typename decay<_Fp>::type,
3372
         class _DecayA0 = typename decay<_A0>::type,
3373
         class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
3374
using __enable_if_bullet3 = typename enable_if
3375
    <
3376
        is_member_function_pointer<_DecayFp>::value
3377
        && !is_base_of<_ClassT, _DecayA0>::value
3378
        && !__is_reference_wrapper<_DecayA0>::value
3379
    >::type;
3380
3381
template <class _Fp, class _A0,
3382
         class _DecayFp = typename decay<_Fp>::type,
3383
         class _DecayA0 = typename decay<_A0>::type,
3384
         class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
3385
using __enable_if_bullet4 = typename enable_if
3386
    <
3387
        is_member_object_pointer<_DecayFp>::value
3388
        && is_base_of<_ClassT, _DecayA0>::value
3389
    >::type;
3390
3391
template <class _Fp, class _A0,
3392
         class _DecayFp = typename decay<_Fp>::type,
3393
         class _DecayA0 = typename decay<_A0>::type>
3394
using __enable_if_bullet5 = typename enable_if
3395
    <
3396
        is_member_object_pointer<_DecayFp>::value
3397
        && __is_reference_wrapper<_DecayA0>::value
3398
    >::type;
3399
3400
template <class _Fp, class _A0,
3401
         class _DecayFp = typename decay<_Fp>::type,
3402
         class _DecayA0 = typename decay<_A0>::type,
3403
         class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
3404
using __enable_if_bullet6 = typename enable_if
3405
    <
3406
        is_member_object_pointer<_DecayFp>::value
3407
        && !is_base_of<_ClassT, _DecayA0>::value
3408
        && !__is_reference_wrapper<_DecayA0>::value
3409
    >::type;
3410
3411
// __invoke forward declarations
3412
3413
// fall back - none of the bullets
3414
3415
#define _LIBCPP_INVOKE_RETURN(...) \
3416
    noexcept(noexcept(__VA_ARGS__)) -> decltype(__VA_ARGS__) \
3417
144k
    { return __VA_ARGS__; }
3418
3419
template <class ..._Args>
3420
auto __invoke(__any, _Args&& ...__args) -> __nat;
3421
3422
template <class ..._Args>
3423
auto __invoke_constexpr(__any, _Args&& ...__args) -> __nat;
3424
3425
// bullets 1, 2 and 3
3426
3427
template <class _Fp, class _A0, class ..._Args,
3428
          class = __enable_if_bullet1<_Fp, _A0>>
3429
inline _LIBCPP_INLINE_VISIBILITY
3430
auto
3431
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
3432
_LIBCPP_INVOKE_RETURN((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
3433
3434
template <class _Fp, class _A0, class ..._Args,
3435
          class = __enable_if_bullet1<_Fp, _A0>>
3436
inline _LIBCPP_INLINE_VISIBILITY
3437
_LIBCPP_CONSTEXPR auto
3438
__invoke_constexpr(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
3439
_LIBCPP_INVOKE_RETURN((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
3440
3441
template <class _Fp, class _A0, class ..._Args,
3442
          class = __enable_if_bullet2<_Fp, _A0>>
3443
inline _LIBCPP_INLINE_VISIBILITY
3444
auto
3445
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
3446
_LIBCPP_INVOKE_RETURN((__a0.get().*__f)(_VSTD::forward<_Args>(__args)...))
3447
3448
template <class _Fp, class _A0, class ..._Args,
3449
          class = __enable_if_bullet2<_Fp, _A0>>
3450
inline _LIBCPP_INLINE_VISIBILITY
3451
_LIBCPP_CONSTEXPR auto
3452
__invoke_constexpr(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
3453
_LIBCPP_INVOKE_RETURN((__a0.get().*__f)(_VSTD::forward<_Args>(__args)...))
3454
3455
template <class _Fp, class _A0, class ..._Args,
3456
          class = __enable_if_bullet3<_Fp, _A0>>
3457
inline _LIBCPP_INLINE_VISIBILITY
3458
auto
3459
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
3460
_LIBCPP_INVOKE_RETURN(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
3461
3462
template <class _Fp, class _A0, class ..._Args,
3463
          class = __enable_if_bullet3<_Fp, _A0>>
3464
inline _LIBCPP_INLINE_VISIBILITY
3465
_LIBCPP_CONSTEXPR auto
3466
__invoke_constexpr(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
3467
_LIBCPP_INVOKE_RETURN(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
3468
3469
// bullets 4, 5 and 6
3470
3471
template <class _Fp, class _A0,
3472
          class = __enable_if_bullet4<_Fp, _A0>>
3473
inline _LIBCPP_INLINE_VISIBILITY
3474
auto
3475
__invoke(_Fp&& __f, _A0&& __a0)
3476
_LIBCPP_INVOKE_RETURN(_VSTD::forward<_A0>(__a0).*__f)
3477
3478
template <class _Fp, class _A0,
3479
          class = __enable_if_bullet4<_Fp, _A0>>
3480
inline _LIBCPP_INLINE_VISIBILITY
3481
_LIBCPP_CONSTEXPR auto
3482
__invoke_constexpr(_Fp&& __f, _A0&& __a0)
3483
_LIBCPP_INVOKE_RETURN(_VSTD::forward<_A0>(__a0).*__f)
3484
3485
template <class _Fp, class _A0,
3486
          class = __enable_if_bullet5<_Fp, _A0>>
3487
inline _LIBCPP_INLINE_VISIBILITY
3488
auto
3489
__invoke(_Fp&& __f, _A0&& __a0)
3490
_LIBCPP_INVOKE_RETURN(__a0.get().*__f)
3491
3492
template <class _Fp, class _A0,
3493
          class = __enable_if_bullet5<_Fp, _A0>>
3494
inline _LIBCPP_INLINE_VISIBILITY
3495
_LIBCPP_CONSTEXPR auto
3496
__invoke_constexpr(_Fp&& __f, _A0&& __a0)
3497
_LIBCPP_INVOKE_RETURN(__a0.get().*__f)
3498
3499
template <class _Fp, class _A0,
3500
          class = __enable_if_bullet6<_Fp, _A0>>
3501
inline _LIBCPP_INLINE_VISIBILITY
3502
auto
3503
__invoke(_Fp&& __f, _A0&& __a0)
3504
_LIBCPP_INVOKE_RETURN((*_VSTD::forward<_A0>(__a0)).*__f)
3505
3506
template <class _Fp, class _A0,
3507
          class = __enable_if_bullet6<_Fp, _A0>>
3508
inline _LIBCPP_INLINE_VISIBILITY
3509
_LIBCPP_CONSTEXPR auto
3510
__invoke_constexpr(_Fp&& __f, _A0&& __a0)
3511
_LIBCPP_INVOKE_RETURN((*_VSTD::forward<_A0>(__a0)).*__f)
3512
3513
// bullet 7
3514
3515
template <class _Fp, class ..._Args>
3516
inline _LIBCPP_INLINE_VISIBILITY
3517
auto
3518
__invoke(_Fp&& __f, _Args&& ...__args)
3519
_LIBCPP_INVOKE_RETURN(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))
3520
3521
template <class _Fp, class ..._Args>
3522
inline _LIBCPP_INLINE_VISIBILITY
3523
_LIBCPP_CONSTEXPR auto
3524
__invoke_constexpr(_Fp&& __f, _Args&& ...__args)
3525
_LIBCPP_INVOKE_RETURN(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))
3526
3527
#undef _LIBCPP_INVOKE_RETURN
3528
3529
// __invokable
3530
template <class _Ret, class _Fp, class ..._Args>
3531
struct __invokable_r
3532
{
3533
  template <class _XFp, class ..._XArgs>
3534
  static auto __try_call(int) -> decltype(
3535
    _VSTD::__invoke(_VSTD::declval<_XFp>(), _VSTD::declval<_XArgs>()...));
3536
  template <class _XFp, class ..._XArgs>
3537
  static __nat __try_call(...);
3538
3539
  // FIXME: Check that _Ret, _Fp, and _Args... are all complete types, cv void,
3540
  // or incomplete array types as required by the standard.
3541
  using _Result = decltype(__try_call<_Fp, _Args...>(0));
3542
3543
  using type =
3544
  typename conditional<
3545
      _IsNotSame<_Result, __nat>::value,
3546
      typename conditional<
3547
          is_void<_Ret>::value,
3548
          true_type,
3549
          is_convertible<_Result, _Ret>
3550
      >::type,
3551
      false_type
3552
  >::type;
3553
  static const bool value = type::value;
3554
};
3555
template <class _Fp, class ..._Args>
3556
using __invokable = __invokable_r<void, _Fp, _Args...>;
3557
3558
template <bool _IsInvokable, bool _IsCVVoid, class _Ret, class _Fp, class ..._Args>
3559
struct __nothrow_invokable_r_imp {
3560
  static const bool value = false;
3561
};
3562
3563
template <class _Ret, class _Fp, class ..._Args>
3564
struct __nothrow_invokable_r_imp<true, false, _Ret, _Fp, _Args...>
3565
{
3566
    typedef __nothrow_invokable_r_imp _ThisT;
3567
3568
    template <class _Tp>
3569
    static void __test_noexcept(_Tp) noexcept;
3570
3571
    static const bool value = noexcept(_ThisT::__test_noexcept<_Ret>(
3572
        _VSTD::__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...)));
3573
};
3574
3575
template <class _Ret, class _Fp, class ..._Args>
3576
struct __nothrow_invokable_r_imp<true, true, _Ret, _Fp, _Args...>
3577
{
3578
    static const bool value = noexcept(
3579
        _VSTD::__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...));
3580
};
3581
3582
template <class _Ret, class _Fp, class ..._Args>
3583
using __nothrow_invokable_r =
3584
    __nothrow_invokable_r_imp<
3585
            __invokable_r<_Ret, _Fp, _Args...>::value,
3586
            is_void<_Ret>::value,
3587
            _Ret, _Fp, _Args...
3588
    >;
3589
3590
template <class _Fp, class ..._Args>
3591
using __nothrow_invokable =
3592
    __nothrow_invokable_r_imp<
3593
            __invokable<_Fp, _Args...>::value,
3594
            true, void, _Fp, _Args...
3595
    >;
3596
3597
template <class _Fp, class ..._Args>
3598
struct __invoke_of
3599
    : public enable_if<
3600
        __invokable<_Fp, _Args...>::value,
3601
        typename __invokable_r<void, _Fp, _Args...>::_Result>
3602
{
3603
};
3604
3605
// result_of
3606
3607
template <class _Fp, class ..._Args>
3608
class _LIBCPP_TEMPLATE_VIS result_of<_Fp(_Args...)>
3609
    : public __invoke_of<_Fp, _Args...>
3610
{
3611
};
3612
3613
#if _LIBCPP_STD_VER > 11
3614
template <class _Tp> using result_of_t = typename result_of<_Tp>::type;
3615
#endif
3616
3617
#if _LIBCPP_STD_VER > 14
3618
3619
// invoke_result
3620
3621
template <class _Fn, class... _Args>
3622
struct _LIBCPP_TEMPLATE_VIS invoke_result
3623
    : __invoke_of<_Fn, _Args...>
3624
{
3625
};
3626
3627
template <class _Fn, class... _Args>
3628
using invoke_result_t = typename invoke_result<_Fn, _Args...>::type;
3629
3630
// is_invocable
3631
3632
template <class _Fn, class ..._Args>
3633
struct _LIBCPP_TEMPLATE_VIS is_invocable
3634
    : integral_constant<bool, __invokable<_Fn, _Args...>::value> {};
3635
3636
template <class _Ret, class _Fn, class ..._Args>
3637
struct _LIBCPP_TEMPLATE_VIS is_invocable_r
3638
    : integral_constant<bool, __invokable_r<_Ret, _Fn, _Args...>::value> {};
3639
3640
template <class _Fn, class ..._Args>
3641
_LIBCPP_INLINE_VAR constexpr bool is_invocable_v
3642
    = is_invocable<_Fn, _Args...>::value;
3643
3644
template <class _Ret, class _Fn, class ..._Args>
3645
_LIBCPP_INLINE_VAR constexpr bool is_invocable_r_v
3646
    = is_invocable_r<_Ret, _Fn, _Args...>::value;
3647
3648
// is_nothrow_invocable
3649
3650
template <class _Fn, class ..._Args>
3651
struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable
3652
    : integral_constant<bool, __nothrow_invokable<_Fn, _Args...>::value> {};
3653
3654
template <class _Ret, class _Fn, class ..._Args>
3655
struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable_r
3656
    : integral_constant<bool, __nothrow_invokable_r<_Ret, _Fn, _Args...>::value> {};
3657
3658
template <class _Fn, class ..._Args>
3659
_LIBCPP_INLINE_VAR constexpr bool is_nothrow_invocable_v
3660
    = is_nothrow_invocable<_Fn, _Args...>::value;
3661
3662
template <class _Ret, class _Fn, class ..._Args>
3663
_LIBCPP_INLINE_VAR constexpr bool is_nothrow_invocable_r_v
3664
    = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
3665
3666
#endif // _LIBCPP_STD_VER > 14
3667
3668
#endif  // !defined(_LIBCPP_CXX03_LANG)
3669
3670
template <class _Tp> struct __is_swappable;
3671
template <class _Tp> struct __is_nothrow_swappable;
3672
3673
// swap, swap_ranges
3674
3675
template <class _ForwardIterator1, class _ForwardIterator2>
3676
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3677
_ForwardIterator2
3678
swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2);
3679
3680
template <class _Tp>
3681
inline _LIBCPP_INLINE_VISIBILITY
3682
#ifndef _LIBCPP_CXX03_LANG
3683
typename enable_if
3684
<
3685
    is_move_constructible<_Tp>::value &&
3686
    is_move_assignable<_Tp>::value
3687
>::type
3688
#else
3689
void
3690
#endif
3691
_LIBCPP_CONSTEXPR_AFTER_CXX17
3692
swap(_Tp& __x, _Tp& __y) _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value &&
3693
                                    is_nothrow_move_assignable<_Tp>::value)
3694
1.08G
{
3695
1.08G
    _Tp __t(_VSTD::move(__x));
3696
1.08G
    __x = _VSTD::move(__y);
3697
1.08G
    __y = _VSTD::move(__t);
3698
1.08G
}
std::__1::enable_if<(is_move_constructible<char>::value) && (is_move_assignable<char>::value), void>::type std::__1::swap<char>(char&, char&)
Line
Count
Source
3694
23.8M
{
3695
23.8M
    _Tp __t(_VSTD::move(__x));
3696
23.8M
    __x = _VSTD::move(__y);
3697
23.8M
    __y = _VSTD::move(__t);
3698
23.8M
}
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<wchar_t>::value) && (is_move_assignable<wchar_t>::value), void>::type std::__1::swap<wchar_t>(wchar_t&, wchar_t&)
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<signed char>::value) && (is_move_assignable<signed char>::value), void>::type std::__1::swap<signed char>(signed char&, signed char&)
std::__1::enable_if<(is_move_constructible<unsigned char>::value) && (is_move_assignable<unsigned char>::value), void>::type std::__1::swap<unsigned char>(unsigned char&, unsigned char&)
Line
Count
Source
3694
389
{
3695
389
    _Tp __t(_VSTD::move(__x));
3696
389
    __x = _VSTD::move(__y);
3697
389
    __y = _VSTD::move(__t);
3698
389
}
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<short>::value) && (is_move_assignable<short>::value), void>::type std::__1::swap<short>(short&, short&)
std::__1::enable_if<(is_move_constructible<unsigned short>::value) && (is_move_assignable<unsigned short>::value), void>::type std::__1::swap<unsigned short>(unsigned short&, unsigned short&)
Line
Count
Source
3694
1.22M
{
3695
1.22M
    _Tp __t(_VSTD::move(__x));
3696
1.22M
    __x = _VSTD::move(__y);
3697
1.22M
    __y = _VSTD::move(__t);
3698
1.22M
}
std::__1::enable_if<(is_move_constructible<int>::value) && (is_move_assignable<int>::value), void>::type std::__1::swap<int>(int&, int&)
Line
Count
Source
3694
3.84M
{
3695
3.84M
    _Tp __t(_VSTD::move(__x));
3696
3.84M
    __x = _VSTD::move(__y);
3697
3.84M
    __y = _VSTD::move(__t);
3698
3.84M
}
std::__1::enable_if<(is_move_constructible<unsigned int>::value) && (is_move_assignable<unsigned int>::value), void>::type std::__1::swap<unsigned int>(unsigned int&, unsigned int&)
Line
Count
Source
3694
175M
{
3695
175M
    _Tp __t(_VSTD::move(__x));
3696
175M
    __x = _VSTD::move(__y);
3697
175M
    __y = _VSTD::move(__t);
3698
175M
}
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<long>::value) && (is_move_assignable<long>::value), void>::type std::__1::swap<long>(long&, long&)
std::__1::enable_if<(is_move_constructible<unsigned long>::value) && (is_move_assignable<unsigned long>::value), void>::type std::__1::swap<unsigned long>(unsigned long&, unsigned long&)
Line
Count
Source
3694
3.20M
{
3695
3.20M
    _Tp __t(_VSTD::move(__x));
3696
3.20M
    __x = _VSTD::move(__y);
3697
3.20M
    __y = _VSTD::move(__t);
3698
3.20M
}
std::__1::enable_if<(is_move_constructible<long long>::value) && (is_move_assignable<long long>::value), void>::type std::__1::swap<long long>(long long&, long long&)
Line
Count
Source
3694
87.7k
{
3695
87.7k
    _Tp __t(_VSTD::move(__x));
3696
87.7k
    __x = _VSTD::move(__y);
3697
87.7k
    __y = _VSTD::move(__t);
3698
87.7k
}
std::__1::enable_if<(is_move_constructible<unsigned long long>::value) && (is_move_assignable<unsigned long long>::value), void>::type std::__1::swap<unsigned long long>(unsigned long long&, unsigned long long&)
Line
Count
Source
3694
59.0M
{
3695
59.0M
    _Tp __t(_VSTD::move(__x));
3696
59.0M
    __x = _VSTD::move(__y);
3697
59.0M
    __y = _VSTD::move(__t);
3698
59.0M
}
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<float>::value) && (is_move_assignable<float>::value), void>::type std::__1::swap<float>(float&, float&)
std::__1::enable_if<(is_move_constructible<double>::value) && (is_move_assignable<double>::value), void>::type std::__1::swap<double>(double&, double&)
Line
Count
Source
3694
24
{
3695
24
    _Tp __t(_VSTD::move(__x));
3696
24
    __x = _VSTD::move(__y);
3697
24
    __y = _VSTD::move(__t);
3698
24
}
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<long double>::value) && (is_move_assignable<long double>::value), void>::type std::__1::swap<long double>(long double&, long double&)
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<_opaque_pthread_t*>::value) && (is_move_assignable<_opaque_pthread_t*>::value), void>::type std::__1::swap<_opaque_pthread_t*>(_opaque_pthread_t*&, _opaque_pthread_t*&)
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<std::__1::__i_node**>::value) && (is_move_assignable<std::__1::__i_node**>::value), void>::type std::__1::swap<std::__1::__i_node**>(std::__1::__i_node**&, std::__1::__i_node**&)
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<std::__1::locale>::value) && (is_move_assignable<std::__1::locale>::value), void>::type std::__1::swap<std::__1::locale>(std::__1::locale&, std::__1::locale&)
std::__1::enable_if<(is_move_constructible<char*>::value) && (is_move_assignable<char*>::value), void>::type std::__1::swap<char*>(char*&, char*&)
Line
Count
Source
3694
56.2k
{
3695
56.2k
    _Tp __t(_VSTD::move(__x));
3696
56.2k
    __x = _VSTD::move(__y);
3697
56.2k
    __y = _VSTD::move(__t);
3698
56.2k
}
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<wchar_t*>::value) && (is_move_assignable<wchar_t*>::value), void>::type std::__1::swap<wchar_t*>(wchar_t*&, wchar_t*&)
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<std::__1::basic_ostream<char, std::__1::char_traits<char> >*>::value) && (is_move_assignable<std::__1::basic_ostream<char, std::__1::char_traits<char> >*>::value), void>::type std::__1::swap<std::__1::basic_ostream<char, std::__1::char_traits<char> >*>(std::__1::basic_ostream<char, std::__1::char_traits<char> >*&, std::__1::basic_ostream<char, std::__1::char_traits<char> >*&)
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >*>::value) && (is_move_assignable<std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >*>::value), void>::type std::__1::swap<std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >*>(std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >*&, std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >*&)
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<void (**)(std::__1::ios_base::event, std::__1::ios_base&, int)>::value) && (is_move_assignable<void (**)(std::__1::ios_base::event, std::__1::ios_base&, int)>::value), void>::type std::__1::swap<void (**)(std::__1::ios_base::event, std::__1::ios_base&, int)>(void (**&)(std::__1::ios_base::event, std::__1::ios_base&, int), void (**&)(std::__1::ios_base::event, std::__1::ios_base&, int))
std::__1::enable_if<(is_move_constructible<int*>::value) && (is_move_assignable<int*>::value), void>::type std::__1::swap<int*>(int*&, int*&)
Line
Count
Source
3694
9.53M
{
3695
9.53M
    _Tp __t(_VSTD::move(__x));
3696
9.53M
    __x = _VSTD::move(__y);
3697
9.53M
    __y = _VSTD::move(__t);
3698
9.53M
}
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<long*>::value) && (is_move_assignable<long*>::value), void>::type std::__1::swap<long*>(long*&, long*&)
std::__1::enable_if<(is_move_constructible<void**>::value) && (is_move_assignable<void**>::value), void>::type std::__1::swap<void**>(void**&, void**&)
Line
Count
Source
3694
10.7k
{
3695
10.7k
    _Tp __t(_VSTD::move(__x));
3696
10.7k
    __x = _VSTD::move(__y);
3697
10.7k
    __y = _VSTD::move(__t);
3698
10.7k
}
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<std::__1::locale::facet**>::value) && (is_move_assignable<std::__1::locale::facet**>::value), void>::type std::__1::swap<std::__1::locale::facet**>(std::__1::locale::facet**&, std::__1::locale::facet**&)
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<void* (*)(unsigned long)>::value) && (is_move_assignable<void* (*)(unsigned long)>::value), void>::type std::__1::swap<void* (*)(unsigned long)>(void* (*&)(unsigned long), void* (*&)(unsigned long))
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<void (*)(void*)>::value) && (is_move_assignable<void (*)(void*)>::value), void>::type std::__1::swap<void (*)(void*)>(void (*&)(void*), void (*&)(void*))
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<std::__1::pair<std::__1::condition_variable*, std::__1::mutex*>*>::value) && (is_move_assignable<std::__1::pair<std::__1::condition_variable*, std::__1::mutex*>*>::value), void>::type std::__1::swap<std::__1::pair<std::__1::condition_variable*, std::__1::mutex*>*>(std::__1::pair<std::__1::condition_variable*, std::__1::mutex*>*&, std::__1::pair<std::__1::condition_variable*, std::__1::mutex*>*&)
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<std::__1::__assoc_sub_state**>::value) && (is_move_assignable<std::__1::__assoc_sub_state**>::value), void>::type std::__1::swap<std::__1::__assoc_sub_state**>(std::__1::__assoc_sub_state**&, std::__1::__assoc_sub_state**&)
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__fs::filesystem::PathPartKind>*>::value) && (is_move_assignable<std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__fs::filesystem::PathPartKind>*>::value), void>::type std::__1::swap<std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__fs::filesystem::PathPartKind>*>(std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__fs::filesystem::PathPartKind>*&, std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__fs::filesystem::PathPartKind>*&)
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<std::__1::basic_string_view<char, std::__1::char_traits<char> >*>::value) && (is_move_assignable<std::__1::basic_string_view<char, std::__1::char_traits<char> >*>::value), void>::type std::__1::swap<std::__1::basic_string_view<char, std::__1::char_traits<char> >*>(std::__1::basic_string_view<char, std::__1::char_traits<char> >*&, std::__1::basic_string_view<char, std::__1::char_traits<char> >*&)
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<std::__1::__fs::filesystem::__dir_stream*>::value) && (is_move_assignable<std::__1::__fs::filesystem::__dir_stream*>::value), void>::type std::__1::swap<std::__1::__fs::filesystem::__dir_stream*>(std::__1::__fs::filesystem::__dir_stream*&, std::__1::__fs::filesystem::__dir_stream*&)
std::__1::enable_if<(is_move_constructible<std::__1::__shared_weak_count*>::value) && (is_move_assignable<std::__1::__shared_weak_count*>::value), void>::type std::__1::swap<std::__1::__shared_weak_count*>(std::__1::__shared_weak_count*&, std::__1::__shared_weak_count*&)
Line
Count
Source
3694
809M
{
3695
809M
    _Tp __t(_VSTD::move(__x));
3696
809M
    __x = _VSTD::move(__y);
3697
809M
    __y = _VSTD::move(__t);
3698
809M
}
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp*>::value) && (is_move_assignable<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp*>::value), void>::type std::__1::swap<std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp*>(std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp*&, std::__1::__fs::filesystem::recursive_directory_iterator::__shared_imp*&)
Unexecuted instantiation: std::__1::enable_if<(is_move_constructible<std::__1::__fs::filesystem::__dir_stream**>::value) && (is_move_assignable<std::__1::__fs::filesystem::__dir_stream**>::value), void>::type std::__1::swap<std::__1::__fs::filesystem::__dir_stream**>(std::__1::__fs::filesystem::__dir_stream**&, std::__1::__fs::filesystem::__dir_stream**&)
3699
3700
template<class _Tp, size_t _Np>
3701
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3702
typename enable_if<
3703
    __is_swappable<_Tp>::value
3704
>::type
3705
swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
3706
{
3707
    _VSTD::swap_ranges(__a, __a + _Np, __b);
3708
}
3709
3710
template <class _ForwardIterator1, class _ForwardIterator2>
3711
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3712
_ForwardIterator2
3713
swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2)
3714
0
{
3715
0
    for(; __first1 != __last1; ++__first1, (void) ++__first2)
3716
0
        swap(*__first1, *__first2);
3717
0
    return __first2;
3718
0
}
Unexecuted instantiation: std::__1::__wrap_iter<char*> std::__1::swap_ranges<std::__1::__wrap_iter<char*>, std::__1::__wrap_iter<char*> >(std::__1::__wrap_iter<char*>, std::__1::__wrap_iter<char*>, std::__1::__wrap_iter<char*>)
Unexecuted instantiation: std::__1::__wrap_iter<wchar_t*> std::__1::swap_ranges<std::__1::__wrap_iter<wchar_t*>, std::__1::__wrap_iter<wchar_t*> >(std::__1::__wrap_iter<wchar_t*>, std::__1::__wrap_iter<wchar_t*>, std::__1::__wrap_iter<wchar_t*>)
3719
3720
// iter_swap
3721
3722
template <class _ForwardIterator1, class _ForwardIterator2>
3723
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3724
void
3725
iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
3726
    //                                  _NOEXCEPT_(_NOEXCEPT_(swap(*__a, *__b)))
3727
               _NOEXCEPT_(_NOEXCEPT_(swap(*_VSTD::declval<_ForwardIterator1>(),
3728
                                          *_VSTD::declval<_ForwardIterator2>())))
3729
144k
{
3730
144k
    swap(*__a, *__b);
3731
144k
}
void std::__1::iter_swap<unsigned int*, unsigned int*>(unsigned int*, unsigned int*)
Line
Count
Source
3729
2.67k
{
3730
2.67k
    swap(*__a, *__b);
3731
2.67k
}
void std::__1::iter_swap<char*, char*>(char*, char*)
Line
Count
Source
3729
141k
{
3730
141k
    swap(*__a, *__b);
3731
141k
}
Unexecuted instantiation: void std::__1::iter_swap<wchar_t*, wchar_t*>(wchar_t*, wchar_t*)
3732
3733
// __swappable
3734
3735
namespace __detail
3736
{
3737
// ALL generic swap overloads MUST already have a declaration available at this point.
3738
3739
template <class _Tp, class _Up = _Tp,
3740
          bool _NotVoid = !is_void<_Tp>::value && !is_void<_Up>::value>
3741
struct __swappable_with
3742
{
3743
    template <class _LHS, class _RHS>
3744
    static decltype(swap(_VSTD::declval<_LHS>(), _VSTD::declval<_RHS>()))
3745
    __test_swap(int);
3746
    template <class, class>
3747
    static __nat __test_swap(long);
3748
3749
    // Extra parens are needed for the C++03 definition of decltype.
3750
    typedef decltype((__test_swap<_Tp, _Up>(0))) __swap1;
3751
    typedef decltype((__test_swap<_Up, _Tp>(0))) __swap2;
3752
3753
    static const bool value = _IsNotSame<__swap1, __nat>::value
3754
                           && _IsNotSame<__swap2, __nat>::value;
3755
};
3756
3757
template <class _Tp, class _Up>
3758
struct __swappable_with<_Tp, _Up,  false> : false_type {};
3759
3760
template <class _Tp, class _Up = _Tp, bool _Swappable = __swappable_with<_Tp, _Up>::value>
3761
struct __nothrow_swappable_with {
3762
  static const bool value =
3763
#ifndef _LIBCPP_HAS_NO_NOEXCEPT
3764
      noexcept(swap(_VSTD::declval<_Tp>(), _VSTD::declval<_Up>()))
3765
  &&  noexcept(swap(_VSTD::declval<_Up>(), _VSTD::declval<_Tp>()));
3766
#else
3767
      false;
3768
#endif
3769
};
3770
3771
template <class _Tp, class _Up>
3772
struct __nothrow_swappable_with<_Tp, _Up, false> : false_type {};
3773
3774
}  // __detail
3775
3776
template <class _Tp>
3777
struct __is_swappable
3778
    : public integral_constant<bool, __detail::__swappable_with<_Tp&>::value>
3779
{
3780
};
3781
3782
template <class _Tp>
3783
struct __is_nothrow_swappable
3784
    : public integral_constant<bool, __detail::__nothrow_swappable_with<_Tp&>::value>
3785
{
3786
};
3787
3788
#if _LIBCPP_STD_VER > 14
3789
3790
template <class _Tp, class _Up>
3791
struct _LIBCPP_TEMPLATE_VIS is_swappable_with
3792
    : public integral_constant<bool, __detail::__swappable_with<_Tp, _Up>::value>
3793
{
3794
};
3795
3796
template <class _Tp>
3797
struct _LIBCPP_TEMPLATE_VIS is_swappable
3798
    : public conditional<
3799
        __is_referenceable<_Tp>::value,
3800
        is_swappable_with<
3801
            typename add_lvalue_reference<_Tp>::type,
3802
            typename add_lvalue_reference<_Tp>::type>,
3803
        false_type
3804
    >::type
3805
{
3806
};
3807
3808
template <class _Tp, class _Up>
3809
struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable_with
3810
    : public integral_constant<bool, __detail::__nothrow_swappable_with<_Tp, _Up>::value>
3811
{
3812
};
3813
3814
template <class _Tp>
3815
struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable
3816
    : public conditional<
3817
        __is_referenceable<_Tp>::value,
3818
        is_nothrow_swappable_with<
3819
            typename add_lvalue_reference<_Tp>::type,
3820
            typename add_lvalue_reference<_Tp>::type>,
3821
        false_type
3822
    >::type
3823
{
3824
};
3825
3826
template <class _Tp, class _Up>
3827
_LIBCPP_INLINE_VAR constexpr bool is_swappable_with_v
3828
    = is_swappable_with<_Tp, _Up>::value;
3829
3830
template <class _Tp>
3831
_LIBCPP_INLINE_VAR constexpr bool is_swappable_v
3832
    = is_swappable<_Tp>::value;
3833
3834
template <class _Tp, class _Up>
3835
_LIBCPP_INLINE_VAR constexpr bool is_nothrow_swappable_with_v
3836
    = is_nothrow_swappable_with<_Tp, _Up>::value;
3837
3838
template <class _Tp>
3839
_LIBCPP_INLINE_VAR constexpr bool is_nothrow_swappable_v
3840
    = is_nothrow_swappable<_Tp>::value;
3841
3842
#endif // _LIBCPP_STD_VER > 14
3843
3844
template <class _Tp, bool = is_enum<_Tp>::value> struct __underlying_type_impl;
3845
3846
template <class _Tp>
3847
struct __underlying_type_impl<_Tp, false> {};
3848
3849
template <class _Tp>
3850
struct __underlying_type_impl<_Tp, true>
3851
{
3852
    typedef __underlying_type(_Tp) type;
3853
};
3854
3855
template <class _Tp>
3856
struct underlying_type : __underlying_type_impl<_Tp, is_enum<_Tp>::value> {};
3857
3858
#if _LIBCPP_STD_VER > 11
3859
template <class _Tp> using underlying_type_t = typename underlying_type<_Tp>::type;
3860
#endif
3861
3862
3863
template <class _Tp, bool = is_enum<_Tp>::value>
3864
struct __sfinae_underlying_type
3865
{
3866
    typedef typename underlying_type<_Tp>::type type;
3867
    typedef decltype(((type)1) + 0) __promoted_type;
3868
};
3869
3870
template <class _Tp>
3871
struct __sfinae_underlying_type<_Tp, false> {};
3872
3873
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
3874
0
int __convert_to_integral(int __val) { return __val; }
3875
3876
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
3877
unsigned __convert_to_integral(unsigned __val) { return __val; }
3878
3879
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
3880
long __convert_to_integral(long __val) { return __val; }
3881
3882
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
3883
unsigned long __convert_to_integral(unsigned long __val) { return __val; }
3884
3885
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
3886
0
long long __convert_to_integral(long long __val) { return __val; }
3887
3888
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
3889
0
unsigned long long __convert_to_integral(unsigned long long __val) {return __val; }
3890
3891
template<typename _Fp>
3892
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
3893
typename enable_if<is_floating_point<_Fp>::value, long long>::type
3894
 __convert_to_integral(_Fp __val) { return __val; }
3895
3896
#ifndef _LIBCPP_HAS_NO_INT128
3897
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
3898
0
__int128_t __convert_to_integral(__int128_t __val) { return __val; }
3899
3900
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
3901
0
__uint128_t __convert_to_integral(__uint128_t __val) { return __val; }
3902
#endif
3903
3904
template <class _Tp>
3905
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
3906
typename __sfinae_underlying_type<_Tp>::__promoted_type
3907
__convert_to_integral(_Tp __val) { return __val; }
3908
3909
#ifndef _LIBCPP_CXX03_LANG
3910
3911
template <class _Tp>
3912
struct __has_operator_addressof_member_imp
3913
{
3914
    template <class _Up>
3915
        static auto __test(int)
3916
            -> typename __select_2nd<decltype(_VSTD::declval<_Up>().operator&()), true_type>::type;
3917
    template <class>
3918
        static auto __test(long) -> false_type;
3919
3920
    static const bool value = decltype(__test<_Tp>(0))::value;
3921
};
3922
3923
template <class _Tp>
3924
struct __has_operator_addressof_free_imp
3925
{
3926
    template <class _Up>
3927
        static auto __test(int)
3928
            -> typename __select_2nd<decltype(operator&(_VSTD::declval<_Up>())), true_type>::type;
3929
    template <class>
3930
        static auto __test(long) -> false_type;
3931
3932
    static const bool value = decltype(__test<_Tp>(0))::value;
3933
};
3934
3935
template <class _Tp>
3936
struct __has_operator_addressof
3937
    : public integral_constant<bool, __has_operator_addressof_member_imp<_Tp>::value
3938
                                  || __has_operator_addressof_free_imp<_Tp>::value>
3939
{};
3940
3941
#endif  // _LIBCPP_CXX03_LANG
3942
3943
#if _LIBCPP_STD_VER > 14
3944
3945
template <class...> using void_t = void;
3946
3947
template <class... _Args>
3948
struct conjunction : _And<_Args...> {};
3949
template<class... _Args>
3950
_LIBCPP_INLINE_VAR constexpr bool conjunction_v
3951
    = conjunction<_Args...>::value;
3952
3953
template <class... _Args>
3954
struct disjunction : _Or<_Args...> {};
3955
template<class... _Args>
3956
_LIBCPP_INLINE_VAR constexpr bool disjunction_v
3957
    = disjunction<_Args...>::value;
3958
3959
template <class _Tp>
3960
struct negation : _Not<_Tp> {};
3961
template<class _Tp>
3962
_LIBCPP_INLINE_VAR constexpr bool negation_v
3963
    = negation<_Tp>::value;
3964
#endif  // _LIBCPP_STD_VER > 14
3965
3966
// These traits are used in __tree and __hash_table
3967
#ifndef _LIBCPP_CXX03_LANG
3968
struct __extract_key_fail_tag {};
3969
struct __extract_key_self_tag {};
3970
struct __extract_key_first_tag {};
3971
3972
template <class _ValTy, class _Key,
3973
          class _RawValTy = typename __unconstref<_ValTy>::type>
3974
struct __can_extract_key
3975
    : conditional<_IsSame<_RawValTy, _Key>::value, __extract_key_self_tag,
3976
                  __extract_key_fail_tag>::type {};
3977
3978
template <class _Pair, class _Key, class _First, class _Second>
3979
struct __can_extract_key<_Pair, _Key, pair<_First, _Second>>
3980
    : conditional<_IsSame<typename remove_const<_First>::type, _Key>::value,
3981
                  __extract_key_first_tag, __extract_key_fail_tag>::type {};
3982
3983
// __can_extract_map_key uses true_type/false_type instead of the tags.
3984
// It returns true if _Key != _ContainerValueTy (the container is a map not a set)
3985
// and _ValTy == _Key.
3986
template <class _ValTy, class _Key, class _ContainerValueTy,
3987
          class _RawValTy = typename __unconstref<_ValTy>::type>
3988
struct __can_extract_map_key
3989
    : integral_constant<bool, _IsSame<_RawValTy, _Key>::value> {};
3990
3991
// This specialization returns __extract_key_fail_tag for non-map containers
3992
// because _Key == _ContainerValueTy
3993
template <class _ValTy, class _Key, class _RawValTy>
3994
struct __can_extract_map_key<_ValTy, _Key, _Key, _RawValTy>
3995
    : false_type {};
3996
3997
#endif
3998
3999
#ifndef _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED
4000
#if _LIBCPP_STD_VER > 17
4001
_LIBCPP_INLINE_VISIBILITY
4002
inline constexpr bool is_constant_evaluated() noexcept {
4003
  return __builtin_is_constant_evaluated();
4004
}
4005
#endif
4006
4007
inline _LIBCPP_CONSTEXPR
4008
0
bool __libcpp_is_constant_evaluated() _NOEXCEPT { return __builtin_is_constant_evaluated(); }
4009
#else
4010
inline _LIBCPP_CONSTEXPR
4011
bool __libcpp_is_constant_evaluated() _NOEXCEPT { return false; }
4012
#endif
4013
4014
template <class _CharT>
4015
using _IsCharLikeType = _And<is_standard_layout<_CharT>, is_trivial<_CharT> >;
4016
4017
_LIBCPP_END_NAMESPACE_STD
4018
4019
#if _LIBCPP_STD_VER > 14
4020
// std::byte
4021
namespace std  // purposefully not versioned
4022
{
4023
4024
4025
}
4026
#endif
4027
4028
#endif  // _LIBCPP_TYPE_TRAITS