@@ -434,10 +434,15 @@ public:
434
434
_LIBCPP_INLINE_VISIBILITY
435
435
vector (initializer_list<value_type> __il, const allocator_type& __a);
436
436
437
+ _LIBCPP_INLINE_VISIBILITY
438
+ vector& operator =(initializer_list<value_type> __il)
439
+ {assign (__il.begin (), __il.end ()); return *this ;}
440
+ #endif // !_LIBCPP_CXX03_LANG
441
+
437
442
_LIBCPP_INLINE_VISIBILITY
438
443
vector (vector&& __x)
439
444
#if _LIBCPP_STD_VER > 14
440
- _NOEXCEPT ;
445
+ noexcept ;
441
446
#else
442
447
_NOEXCEPT_ (is_nothrow_move_constructible<allocator_type>::value);
443
448
#endif
@@ -448,12 +453,6 @@ public:
448
453
vector& operator =(vector&& __x)
449
454
_NOEXCEPT_ ((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
450
455
451
- _LIBCPP_INLINE_VISIBILITY
452
- vector& operator =(initializer_list<value_type> __il)
453
- {assign (__il.begin (), __il.end ()); return *this ;}
454
-
455
- #endif // !_LIBCPP_CXX03_LANG
456
-
457
456
template <class _InputIterator >
458
457
typename enable_if
459
458
<
@@ -565,41 +564,26 @@ public:
565
564
const value_type* data () const _NOEXCEPT
566
565
{return _VSTD::__to_address (this ->__begin_ );}
567
566
568
- #ifdef _LIBCPP_CXX03_LANG
569
- _LIBCPP_INLINE_VISIBILITY
570
- void __emplace_back (const value_type& __x) { push_back (__x); }
571
- #else
572
- template <class _Arg >
573
- _LIBCPP_INLINE_VISIBILITY
574
- void __emplace_back (_Arg&& __arg) {
575
- emplace_back (_VSTD::forward<_Arg>(__arg));
576
- }
577
- #endif
578
-
579
567
_LIBCPP_INLINE_VISIBILITY void push_back (const_reference __x);
580
568
581
- #ifndef _LIBCPP_CXX03_LANG
582
569
_LIBCPP_INLINE_VISIBILITY void push_back (value_type&& __x);
583
570
584
571
template <class ... _Args>
585
- _LIBCPP_INLINE_VISIBILITY
572
+ _LIBCPP_INLINE_VISIBILITY
586
573
#if _LIBCPP_STD_VER > 14
587
574
reference emplace_back (_Args&&... __args);
588
575
#else
589
576
void emplace_back (_Args&&... __args);
590
577
#endif
591
- #endif // !_LIBCPP_CXX03_LANG
592
578
593
579
_LIBCPP_INLINE_VISIBILITY
594
580
void pop_back ();
595
581
596
582
iterator insert (const_iterator __position, const_reference __x);
597
583
598
- #ifndef _LIBCPP_CXX03_LANG
599
584
iterator insert (const_iterator __position, value_type&& __x);
600
585
template <class ... _Args>
601
- iterator emplace (const_iterator __position, _Args&&... __args);
602
- #endif // !_LIBCPP_CXX03_LANG
586
+ iterator emplace (const_iterator __position, _Args&&... __args);
603
587
604
588
iterator insert (const_iterator __position, size_type __n, const_reference __x);
605
589
template <class _InputIterator >
@@ -724,19 +708,13 @@ private:
724
708
__annotate_shrink (__old_size);
725
709
}
726
710
727
- #ifndef _LIBCPP_CXX03_LANG
728
711
template <class _Up >
729
712
_LIBCPP_INLINE_VISIBILITY
730
713
inline void __push_back_slow_path (_Up&& __x);
731
714
732
715
template <class ... _Args>
733
716
_LIBCPP_INLINE_VISIBILITY
734
717
inline void __emplace_back_slow_path (_Args&&... __args);
735
- #else
736
- template <class _Up >
737
- _LIBCPP_INLINE_VISIBILITY
738
- inline void __push_back_slow_path (_Up& __x);
739
- #endif
740
718
741
719
// The following functions are no-ops outside of AddressSanitizer mode.
742
720
// We call annotatations only for the default Allocator because other allocators
@@ -1110,7 +1088,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first,
1110
1088
{
1111
1089
_VSTD::__debug_db_insert_c (this );
1112
1090
for (; __first != __last; ++__first)
1113
- __emplace_back (*__first);
1091
+ emplace_back (*__first);
1114
1092
}
1115
1093
1116
1094
template <class _Tp , class _Allocator >
@@ -1125,7 +1103,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, c
1125
1103
{
1126
1104
_VSTD::__debug_db_insert_c (this );
1127
1105
for (; __first != __last; ++__first)
1128
- __emplace_back (*__first);
1106
+ emplace_back (*__first);
1129
1107
}
1130
1108
1131
1109
template <class _Tp , class _Allocator >
@@ -1190,13 +1168,11 @@ vector<_Tp, _Allocator>::vector(const vector& __x, const __type_identity_t<alloc
1190
1168
}
1191
1169
}
1192
1170
1193
- #ifndef _LIBCPP_CXX03_LANG
1194
-
1195
1171
template <class _Tp , class _Allocator >
1196
1172
inline _LIBCPP_INLINE_VISIBILITY
1197
1173
vector<_Tp, _Allocator>::vector(vector&& __x)
1198
1174
#if _LIBCPP_STD_VER > 14
1199
- _NOEXCEPT
1175
+ noexcept
1200
1176
#else
1201
1177
_NOEXCEPT_ (is_nothrow_move_constructible<allocator_type>::value)
1202
1178
#endif
@@ -1231,6 +1207,8 @@ vector<_Tp, _Allocator>::vector(vector&& __x, const __type_identity_t<allocator_
1231
1207
}
1232
1208
}
1233
1209
1210
+ #ifndef _LIBCPP_CXX03_LANG
1211
+
1234
1212
template <class _Tp , class _Allocator >
1235
1213
inline _LIBCPP_INLINE_VISIBILITY
1236
1214
vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il)
@@ -1256,6 +1234,8 @@ vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il, const allocat
1256
1234
}
1257
1235
}
1258
1236
1237
+ #endif // _LIBCPP_CXX03_LANG
1238
+
1259
1239
template <class _Tp , class _Allocator >
1260
1240
inline _LIBCPP_INLINE_VISIBILITY
1261
1241
vector<_Tp, _Allocator>&
@@ -1295,8 +1275,6 @@ vector<_Tp, _Allocator>::__move_assign(vector& __c, true_type)
1295
1275
std::__debug_db_swap (this , std::addressof (__c));
1296
1276
}
1297
1277
1298
- #endif // !_LIBCPP_CXX03_LANG
1299
-
1300
1278
template <class _Tp , class _Allocator >
1301
1279
inline _LIBCPP_INLINE_VISIBILITY
1302
1280
vector<_Tp, _Allocator>&
@@ -1325,7 +1303,7 @@ vector<_Tp, _Allocator>::assign(_InputIterator __first, _InputIterator __last)
1325
1303
{
1326
1304
clear ();
1327
1305
for (; __first != __last; ++__first)
1328
- __emplace_back (*__first);
1306
+ emplace_back (*__first);
1329
1307
}
1330
1308
1331
1309
template <class _Tp , class _Allocator >
@@ -1519,11 +1497,7 @@ vector<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
1519
1497
template <class _Tp , class _Allocator >
1520
1498
template <class _Up >
1521
1499
void
1522
- #ifndef _LIBCPP_CXX03_LANG
1523
1500
vector<_Tp, _Allocator>::__push_back_slow_path (_Up&& __x)
1524
- #else
1525
- vector<_Tp, _Allocator>::__push_back_slow_path (_Up& __x)
1526
- #endif
1527
1501
{
1528
1502
allocator_type& __a = this ->__alloc ();
1529
1503
__split_buffer<value_type, allocator_type&> __v (__recommend (size () + 1 ), size (), __a);
@@ -1546,8 +1520,6 @@ vector<_Tp, _Allocator>::push_back(const_reference __x)
1546
1520
__push_back_slow_path (__x);
1547
1521
}
1548
1522
1549
- #ifndef _LIBCPP_CXX03_LANG
1550
-
1551
1523
template <class _Tp , class _Allocator >
1552
1524
inline _LIBCPP_INLINE_VISIBILITY
1553
1525
void
@@ -1595,8 +1567,6 @@ vector<_Tp, _Allocator>::emplace_back(_Args&&... __args)
1595
1567
#endif
1596
1568
}
1597
1569
1598
- #endif // !_LIBCPP_CXX03_LANG
1599
-
1600
1570
template <class _Tp , class _Allocator >
1601
1571
inline
1602
1572
void
@@ -1693,8 +1663,6 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)
1693
1663
return __make_iter (__p);
1694
1664
}
1695
1665
1696
- #ifndef _LIBCPP_CXX03_LANG
1697
-
1698
1666
template <class _Tp , class _Allocator >
1699
1667
typename vector<_Tp, _Allocator>::iterator
1700
1668
vector<_Tp, _Allocator>::insert (const_iterator __position, value_type&& __x)
@@ -1755,8 +1723,6 @@ vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args)
1755
1723
return __make_iter (__p);
1756
1724
}
1757
1725
1758
- #endif // !_LIBCPP_CXX03_LANG
1759
-
1760
1726
template <class _Tp , class _Allocator >
1761
1727
typename vector<_Tp, _Allocator>::iterator
1762
1728
vector<_Tp, _Allocator>::insert (const_iterator __position, size_type __n, const_reference __x)
@@ -2125,10 +2091,16 @@ public:
2125
2091
vector (initializer_list<value_type> __il);
2126
2092
vector (initializer_list<value_type> __il, const allocator_type& __a);
2127
2093
2094
+ _LIBCPP_INLINE_VISIBILITY
2095
+ vector& operator =(initializer_list<value_type> __il)
2096
+ {assign (__il.begin (), __il.end ()); return *this ;}
2097
+
2098
+ #endif // !_LIBCPP_CXX03_LANG
2099
+
2128
2100
_LIBCPP_INLINE_VISIBILITY
2129
2101
vector (vector&& __v)
2130
2102
#if _LIBCPP_STD_VER > 14
2131
- _NOEXCEPT ;
2103
+ noexcept ;
2132
2104
#else
2133
2105
_NOEXCEPT_ (is_nothrow_move_constructible<allocator_type>::value);
2134
2106
#endif
@@ -2137,12 +2109,6 @@ public:
2137
2109
vector& operator =(vector&& __v)
2138
2110
_NOEXCEPT_ ((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
2139
2111
2140
- _LIBCPP_INLINE_VISIBILITY
2141
- vector& operator =(initializer_list<value_type> __il)
2142
- {assign (__il.begin (), __il.end ()); return *this ;}
2143
-
2144
- #endif // !_LIBCPP_CXX03_LANG
2145
-
2146
2112
template <class _InputIterator >
2147
2113
typename enable_if
2148
2114
<
@@ -2739,8 +2705,6 @@ vector<bool, _Allocator>::operator=(const vector& __v)
2739
2705
return *this ;
2740
2706
}
2741
2707
2742
- #ifndef _LIBCPP_CXX03_LANG
2743
-
2744
2708
template <class _Allocator >
2745
2709
inline _LIBCPP_INLINE_VISIBILITY vector<bool , _Allocator>::vector (vector&& __v)
2746
2710
#if _LIBCPP_STD_VER > 14
@@ -2812,8 +2776,6 @@ vector<bool, _Allocator>::__move_assign(vector& __c, true_type)
2812
2776
__c.__cap () = __c.__size_ = 0 ;
2813
2777
}
2814
2778
2815
- #endif // !_LIBCPP_CXX03_LANG
2816
-
2817
2779
template <class _Allocator >
2818
2780
void
2819
2781
vector<bool , _Allocator>::assign (size_type __n, const value_type& __x)
0 commit comments