~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to system/include/libcxx/utility

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-09-20 22:44:35 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130920224435-apuwj4fsl3fqv1a6
Tags: 1.5.6~20130920~6010666-1
* New snapshot release
* Update the list of supported architectures to the same as libv8
  (Closes: #723129)
* emlibtool has been removed from upstream.
* Fix warning syntax-error-in-dep5-copyright
* Refresh of the patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
void
39
39
swap(T (&a)[N], T (&b)[N]) noexcept(noexcept(swap(*a, *b)));
40
40
 
41
 
template <class T> T&& forward(typename remove_reference<T>::type& t) noexcept;
42
 
template <class T> T&& forward(typename remove_reference<T>::type&& t) noexcept;
 
41
template <class T> T&& forward(typename remove_reference<T>::type& t) noexcept;  // constexpr in C++14
 
42
template <class T> T&& forward(typename remove_reference<T>::type&& t) noexcept; // constexpr in C++14
43
43
 
44
 
template <class T> typename remove_reference<T>::type&& move(T&&) noexcept;
 
44
template <class T> typename remove_reference<T>::type&& move(T&&) noexcept;      // constexpr in C++14
45
45
 
46
46
template <class T>
47
47
    typename conditional
50
50
        const T&,
51
51
        T&&
52
52
    >::type
53
 
    move_if_noexcept(T& x) noexcept;
 
53
    move_if_noexcept(T& x) noexcept; // constexpr in C++14
54
54
 
55
55
template <class T> typename add_rvalue_reference<T>::type declval() noexcept;
56
56
 
66
66
    pair(const pair&) = default;
67
67
    pair(pair&&) = default;
68
68
    constexpr pair();
69
 
    pair(const T1& x, const T2& y);
70
 
    template <class U, class V> pair(U&& x, V&& y);
71
 
    template <class U, class V> pair(const pair<U, V>& p);
72
 
    template <class U, class V> pair(pair<U, V>&& p);
 
69
    pair(const T1& x, const T2& y);                          // constexpr in C++14
 
70
    template <class U, class V> pair(U&& x, V&& y);          // constexpr in C++14
 
71
    template <class U, class V> pair(const pair<U, V>& p);   // constexpr in C++14
 
72
    template <class U, class V> pair(pair<U, V>&& p);        // constexpr in C++14
73
73
    template <class... Args1, class... Args2>
74
74
        pair(piecewise_construct_t, tuple<Args1...> first_args,
75
75
             tuple<Args2...> second_args);
83
83
                                noexcept(swap(second, p.second)));
84
84
};
85
85
 
86
 
template <class T1, class T2> bool operator==(const pair<T1,T2>&, const pair<T1,T2>&);
87
 
template <class T1, class T2> bool operator!=(const pair<T1,T2>&, const pair<T1,T2>&);
88
 
template <class T1, class T2> bool operator< (const pair<T1,T2>&, const pair<T1,T2>&);
89
 
template <class T1, class T2> bool operator> (const pair<T1,T2>&, const pair<T1,T2>&);
90
 
template <class T1, class T2> bool operator>=(const pair<T1,T2>&, const pair<T1,T2>&);
91
 
template <class T1, class T2> bool operator<=(const pair<T1,T2>&, const pair<T1,T2>&);
 
86
template <class T1, class T2> bool operator==(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
 
87
template <class T1, class T2> bool operator!=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
 
88
template <class T1, class T2> bool operator< (const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
 
89
template <class T1, class T2> bool operator> (const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
 
90
template <class T1, class T2> bool operator>=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
 
91
template <class T1, class T2> bool operator<=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
92
92
 
93
 
template <class T1, class T2> pair<V1, V2> make_pair(T1&&, T2&&);
 
93
template <class T1, class T2> pair<V1, V2> make_pair(T1&&, T2&&);   // constexpr in C++14
94
94
template <class T1, class T2>
95
95
void
96
96
swap(pair<T1, T2>& x, pair<T1, T2>& y) noexcept(noexcept(x.swap(y)));
107
107
 
108
108
template<size_t I, class T1, class T2>
109
109
    typename tuple_element<I, std::pair<T1, T2> >::type&
110
 
    get(std::pair<T1, T2>&) noexcept;
 
110
    get(std::pair<T1, T2>&) noexcept; // constexpr in C++14
111
111
 
112
112
template<size_t I, class T1, class T2>
113
113
    const typename const tuple_element<I, std::pair<T1, T2> >::type&
114
 
    get(const std::pair<T1, T2>&) noexcept;
 
114
    get(const std::pair<T1, T2>&) noexcept; // constexpr in C++14
115
115
 
116
116
template<size_t I, class T1, class T2>
117
117
    typename tuple_element<I, std::pair<T1, T2> >::type&&
118
 
    get(std::pair<T1, T2>&&) noexcept;
119
 
 
 
118
    get(std::pair<T1, T2>&&) noexcept; // constexpr in C++14
 
119
 
 
120
template<class T1, class T2>
 
121
    constexpr T1& get(std::pair<T1, T2>&) noexcept; // C++14
 
122
 
 
123
template<size_t I, class T1, class T2>
 
124
    constexpr T1 const& get(std::pair<T1, T2> const &) noexcept; // C++14
 
125
 
 
126
template<size_t I, class T1, class T2>
 
127
    constexpr T1&& get(std::pair<T1, T2>&&) noexcept; // C++14
 
128
 
 
129
// C++14
 
130
 
 
131
template<class T, T... I>
 
132
struct integer_sequence
 
133
{
 
134
    typedef T value_type;
 
135
 
 
136
    static constexpr size_t size() noexcept;
 
137
};
 
138
 
 
139
template<size_t... I>
 
140
  using index_sequence = integer_sequence<size_t, I...>;
 
141
 
 
142
template<class T, T N>
 
143
  using make_integer_sequence = integer_sequence<T, 0, 1, ..., N-1>;
 
144
template<size_t N>
 
145
  using make_index_sequence = make_integer_sequence<size_t, N>;
 
146
 
 
147
template<class... T>
 
148
  using index_sequence_for = make_index_sequence<sizeof...(T)>;
 
149
 
 
150
template<class T, class U=T> 
 
151
    T exchange(T& obj, U&& new_value);
120
152
}  // std
121
153
 
122
154
*/
189
221
}
190
222
 
191
223
template <class _Tp>
192
 
inline _LIBCPP_INLINE_VISIBILITY
 
224
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
193
225
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
194
226
typename conditional
195
227
<
226
258
 
227
259
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR pair() : first(), second() {}
228
260
 
229
 
    _LIBCPP_INLINE_VISIBILITY pair(const _T1& __x, const _T2& __y)
 
261
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
 
262
    pair(const _T1& __x, const _T2& __y)
230
263
        : first(__x), second(__y) {}
231
264
 
232
265
    template<class _U1, class _U2>
233
 
        _LIBCPP_INLINE_VISIBILITY
 
266
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
234
267
        pair(const pair<_U1, _U2>& __p
235
268
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
236
269
                 ,typename enable_if<is_convertible<const _U1&, _T1>::value &&
239
272
                                      )
240
273
            : first(__p.first), second(__p.second) {}
241
274
 
 
275
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
 
276
    _LIBCPP_INLINE_VISIBILITY
 
277
    pair(const pair& __p) = default;
 
278
#else
242
279
    _LIBCPP_INLINE_VISIBILITY
243
280
    pair(const pair& __p)
244
281
        _NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
247
284
          second(__p.second)
248
285
    {
249
286
    }
 
287
#endif
250
288
 
251
289
    _LIBCPP_INLINE_VISIBILITY
252
290
    pair& operator=(const pair& __p)
263
301
    template <class _U1, class _U2,
264
302
              class = typename enable_if<is_convertible<_U1, first_type>::value &&
265
303
                                         is_convertible<_U2, second_type>::value>::type>
266
 
        _LIBCPP_INLINE_VISIBILITY
 
304
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
267
305
        pair(_U1&& __u1, _U2&& __u2)
268
306
            : first(_VSTD::forward<_U1>(__u1)),
269
307
              second(_VSTD::forward<_U2>(__u2))
270
308
            {}
271
309
 
272
310
    template<class _U1, class _U2>
273
 
        _LIBCPP_INLINE_VISIBILITY
 
311
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
274
312
        pair(pair<_U1, _U2>&& __p,
275
313
                 typename enable_if<is_convertible<_U1, _T1>::value &&
276
314
                                    is_convertible<_U2, _T2>::value>::type* = 0)
277
315
            : first(_VSTD::forward<_U1>(__p.first)),
278
316
              second(_VSTD::forward<_U2>(__p.second)) {}
279
317
 
 
318
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
 
319
    _LIBCPP_INLINE_VISIBILITY
 
320
    pair(pair&& __p) = default;
 
321
#else
280
322
    _LIBCPP_INLINE_VISIBILITY
281
323
    pair(pair&& __p) _NOEXCEPT_(is_nothrow_move_constructible<first_type>::value &&
282
324
                                is_nothrow_move_constructible<second_type>::value)
284
326
          second(_VSTD::forward<second_type>(__p.second))
285
327
    {
286
328
    }
 
329
#endif
287
330
 
288
331
    _LIBCPP_INLINE_VISIBILITY
289
332
    pair&
299
342
 
300
343
    template<class _Tuple,
301
344
             class = typename enable_if<__tuple_convertible<_Tuple, pair>::value>::type>
302
 
        _LIBCPP_INLINE_VISIBILITY
 
345
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
303
346
        pair(_Tuple&& __p)
304
347
            : first(_VSTD::forward<typename tuple_element<0,
305
348
                                  typename __make_tuple_types<_Tuple>::type>::type>(get<0>(__p))),
355
398
};
356
399
 
357
400
template <class _T1, class _T2>
358
 
inline _LIBCPP_INLINE_VISIBILITY
 
401
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
359
402
bool
360
403
operator==(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
361
404
{
363
406
}
364
407
 
365
408
template <class _T1, class _T2>
366
 
inline _LIBCPP_INLINE_VISIBILITY
 
409
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
367
410
bool
368
411
operator!=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
369
412
{
371
414
}
372
415
 
373
416
template <class _T1, class _T2>
374
 
inline _LIBCPP_INLINE_VISIBILITY
 
417
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
375
418
bool
376
419
operator< (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
377
420
{
379
422
}
380
423
 
381
424
template <class _T1, class _T2>
382
 
inline _LIBCPP_INLINE_VISIBILITY
 
425
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
383
426
bool
384
427
operator> (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
385
428
{
387
430
}
388
431
 
389
432
template <class _T1, class _T2>
390
 
inline _LIBCPP_INLINE_VISIBILITY
 
433
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
391
434
bool
392
435
operator>=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
393
436
{
395
438
}
396
439
 
397
440
template <class _T1, class _T2>
398
 
inline _LIBCPP_INLINE_VISIBILITY
 
441
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
399
442
bool
400
443
operator<=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
401
444
{
440
483
};
441
484
 
442
485
template <class _T1, class _T2>
443
 
inline _LIBCPP_INLINE_VISIBILITY
 
486
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
444
487
pair<typename __make_pair_return<_T1>::type, typename __make_pair_return<_T2>::type>
445
488
make_pair(_T1&& __t1, _T2&& __t2)
446
489
{
503
546
{
504
547
    template <class _T1, class _T2>
505
548
    static
506
 
    _LIBCPP_INLINE_VISIBILITY
 
549
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
507
550
    _T1&
508
551
    get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
509
552
 
510
553
    template <class _T1, class _T2>
511
554
    static
512
 
    _LIBCPP_INLINE_VISIBILITY
 
555
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
513
556
    const _T1&
514
557
    get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
515
558
 
517
560
 
518
561
    template <class _T1, class _T2>
519
562
    static
520
 
    _LIBCPP_INLINE_VISIBILITY
 
563
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
521
564
    _T1&&
522
565
    get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T1>(__p.first);}
523
566
 
529
572
{
530
573
    template <class _T1, class _T2>
531
574
    static
532
 
    _LIBCPP_INLINE_VISIBILITY
 
575
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
533
576
    _T2&
534
577
    get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
535
578
 
536
579
    template <class _T1, class _T2>
537
580
    static
538
 
    _LIBCPP_INLINE_VISIBILITY
 
581
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
539
582
    const _T2&
540
583
    get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
541
584
 
543
586
 
544
587
    template <class _T1, class _T2>
545
588
    static
546
 
    _LIBCPP_INLINE_VISIBILITY
 
589
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
547
590
    _T2&&
548
591
    get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T2>(__p.second);}
549
592
 
551
594
};
552
595
 
553
596
template <size_t _Ip, class _T1, class _T2>
554
 
_LIBCPP_INLINE_VISIBILITY inline
 
597
_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR_AFTER_CXX11
555
598
typename tuple_element<_Ip, pair<_T1, _T2> >::type&
556
599
get(pair<_T1, _T2>& __p) _NOEXCEPT
557
600
{
559
602
}
560
603
 
561
604
template <size_t _Ip, class _T1, class _T2>
562
 
_LIBCPP_INLINE_VISIBILITY inline
 
605
_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR_AFTER_CXX11
563
606
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
564
607
get(const pair<_T1, _T2>& __p) _NOEXCEPT
565
608
{
569
612
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
570
613
 
571
614
template <size_t _Ip, class _T1, class _T2>
572
 
_LIBCPP_INLINE_VISIBILITY inline
 
615
_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR_AFTER_CXX11
573
616
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
574
617
get(pair<_T1, _T2>&& __p) _NOEXCEPT
575
618
{
578
621
 
579
622
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
580
623
 
 
624
#if _LIBCPP_STD_VER > 11
 
625
template <class _T1, class _T2>
 
626
_LIBCPP_INLINE_VISIBILITY inline
 
627
constexpr _T1 & get(pair<_T1, _T2>& __p) _NOEXCEPT
 
628
{
 
629
    return __get_pair<0>::get(__p);
 
630
}
 
631
 
 
632
template <class _T1, class _T2>
 
633
_LIBCPP_INLINE_VISIBILITY inline
 
634
constexpr _T1 const & get(pair<_T1, _T2> const& __p) _NOEXCEPT
 
635
{
 
636
    return __get_pair<0>::get(__p);
 
637
}
 
638
 
 
639
template <class _T1, class _T2>
 
640
_LIBCPP_INLINE_VISIBILITY inline
 
641
constexpr _T1 && get(pair<_T1, _T2>&& __p) _NOEXCEPT
 
642
{
 
643
    return __get_pair<0>::get(_VSTD::move(__p));
 
644
}
 
645
 
 
646
template <class _T1, class _T2>
 
647
_LIBCPP_INLINE_VISIBILITY inline
 
648
constexpr _T1 & get(pair<_T2, _T1>& __p) _NOEXCEPT
 
649
{
 
650
    return __get_pair<1>::get(__p);
 
651
}
 
652
 
 
653
template <class _T1, class _T2>
 
654
_LIBCPP_INLINE_VISIBILITY inline
 
655
constexpr _T1 const & get(pair<_T2, _T1> const& __p) _NOEXCEPT
 
656
{
 
657
    return __get_pair<1>::get(__p);
 
658
}
 
659
 
 
660
template <class _T1, class _T2>
 
661
_LIBCPP_INLINE_VISIBILITY inline
 
662
constexpr _T1 && get(pair<_T2, _T1>&& __p) _NOEXCEPT
 
663
{
 
664
    return __get_pair<1>::get(_VSTD::move(__p));
 
665
}
 
666
 
 
667
#endif
 
668
 
 
669
#if _LIBCPP_STD_VER > 11
 
670
 
 
671
template<class _Tp, _Tp... _Ip>
 
672
struct _LIBCPP_TYPE_VIS integer_sequence
 
673
{
 
674
    typedef _Tp value_type;
 
675
    static_assert( is_integral<_Tp>::value,
 
676
                  "std::integer_sequence can only be instantiated with an integral type" );
 
677
    static
 
678
    _LIBCPP_INLINE_VISIBILITY
 
679
    constexpr
 
680
    size_t
 
681
    size() noexcept { return sizeof...(_Ip); }
 
682
};
 
683
 
 
684
template<size_t... _Ip>
 
685
    using index_sequence = integer_sequence<size_t, _Ip...>;
 
686
 
 
687
namespace __detail {
 
688
 
 
689
template<typename _Tp, size_t ..._Extra> struct __repeat;
 
690
template<typename _Tp, _Tp ..._Np, size_t ..._Extra> struct __repeat<integer_sequence<_Tp, _Np...>, _Extra...> {
 
691
  typedef integer_sequence<_Tp,
 
692
                           _Np...,
 
693
                           sizeof...(_Np) + _Np...,
 
694
                           2 * sizeof...(_Np) + _Np...,
 
695
                           3 * sizeof...(_Np) + _Np...,
 
696
                           4 * sizeof...(_Np) + _Np...,
 
697
                           5 * sizeof...(_Np) + _Np...,
 
698
                           6 * sizeof...(_Np) + _Np...,
 
699
                           7 * sizeof...(_Np) + _Np...,
 
700
                           _Extra...> type;
 
701
};
 
702
 
 
703
template<size_t _Np> struct __parity;
 
704
template<size_t _Np> struct __make : __parity<_Np % 8>::template __pmake<_Np> {};
 
705
 
 
706
template<> struct __make<0> { typedef integer_sequence<size_t> type; };
 
707
template<> struct __make<1> { typedef integer_sequence<size_t, 0> type; };
 
708
template<> struct __make<2> { typedef integer_sequence<size_t, 0, 1> type; };
 
709
template<> struct __make<3> { typedef integer_sequence<size_t, 0, 1, 2> type; };
 
710
template<> struct __make<4> { typedef integer_sequence<size_t, 0, 1, 2, 3> type; };
 
711
template<> struct __make<5> { typedef integer_sequence<size_t, 0, 1, 2, 3, 4> type; };
 
712
template<> struct __make<6> { typedef integer_sequence<size_t, 0, 1, 2, 3, 4, 5> type; };
 
713
template<> struct __make<7> { typedef integer_sequence<size_t, 0, 1, 2, 3, 4, 5, 6> type; };
 
714
 
 
715
template<> struct __parity<0> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type> {}; };
 
716
template<> struct __parity<1> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 1> {}; };
 
717
template<> struct __parity<2> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 2, _Np - 1> {}; };
 
718
template<> struct __parity<3> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 3, _Np - 2, _Np - 1> {}; };
 
719
template<> struct __parity<4> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
 
720
template<> struct __parity<5> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
 
721
template<> struct __parity<6> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 6, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
 
722
template<> struct __parity<7> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 7, _Np - 6, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
 
723
 
 
724
template<typename _Tp, typename _Up> struct __convert {
 
725
  template<typename> struct __result;
 
726
  template<_Tp ..._Np> struct __result<integer_sequence<_Tp, _Np...> > { typedef integer_sequence<_Up, _Np...> type; };
 
727
};
 
728
template<typename _Tp> struct __convert<_Tp, _Tp> { template<typename _Up> struct __result { typedef _Up type; }; };
 
729
 
 
730
}
 
731
 
 
732
template<typename _Tp, _Tp _Np> using __make_integer_sequence_unchecked =
 
733
  typename __detail::__convert<size_t, _Tp>::template __result<typename __detail::__make<_Np>::type>::type;
 
734
 
 
735
template <class _Tp, _Tp _Ep>
 
736
struct __make_integer_sequence
 
737
{
 
738
    static_assert(is_integral<_Tp>::value,
 
739
                  "std::make_integer_sequence can only be instantiated with an integral type" );
 
740
    static_assert(0 <= _Ep, "std::make_integer_sequence input shall not be negative");
 
741
    typedef __make_integer_sequence_unchecked<_Tp, _Ep> type;
 
742
};
 
743
 
 
744
template<class _Tp, _Tp _Np>
 
745
    using make_integer_sequence = typename __make_integer_sequence<_Tp, _Np>::type;
 
746
 
 
747
template<size_t _Np>
 
748
    using make_index_sequence = make_integer_sequence<size_t, _Np>;
 
749
 
 
750
template<class... _Tp>
 
751
    using index_sequence_for = make_index_sequence<sizeof...(_Tp)>;
 
752
  
 
753
#endif  // _LIBCPP_STD_VER > 11
 
754
 
 
755
#if _LIBCPP_STD_VER > 11
 
756
template<class _T1, class _T2 = _T1>
 
757
_LIBCPP_INLINE_VISIBILITY inline
 
758
_T1 exchange(_T1& __obj, _T2 && __new_value)
 
759
{
 
760
    _T1 __old_value = _VSTD::move(__obj);
 
761
    __obj = _VSTD::forward<_T2>(__new_value);
 
762
    return __old_value;
 
763
}    
 
764
#endif  // _LIBCPP_STD_VER > 11
 
765
 
581
766
_LIBCPP_END_NAMESPACE_STD
582
767
 
583
768
#endif  // _LIBCPP_UTILITY