@@ -424,11 +424,36 @@ public:
424
424
#endif
425
425
: __end_cap_(nullptr , __a) {
426
426
}
427
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector (size_type __n);
427
+
428
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector (size_type __n) {
429
+ auto __guard = std::__make_exception_guard (__destroy_vector (*this ));
430
+ if (__n > 0 ) {
431
+ __vallocate (__n);
432
+ __construct_at_end (__n);
433
+ }
434
+ __guard.__complete ();
435
+ }
436
+
428
437
#if _LIBCPP_STD_VER >= 14
429
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector (size_type __n, const allocator_type& __a);
438
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector (size_type __n, const allocator_type& __a)
439
+ : __end_cap_(nullptr , __a) {
440
+ auto __guard = std::__make_exception_guard (__destroy_vector (*this ));
441
+ if (__n > 0 ) {
442
+ __vallocate (__n);
443
+ __construct_at_end (__n);
444
+ }
445
+ __guard.__complete ();
446
+ }
430
447
#endif
431
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector (size_type __n, const value_type& __x);
448
+
449
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector (size_type __n, const value_type& __x) {
450
+ auto __guard = std::__make_exception_guard (__destroy_vector (*this ));
451
+ if (__n > 0 ) {
452
+ __vallocate (__n);
453
+ __construct_at_end (__n, __x);
454
+ }
455
+ __guard.__complete ();
456
+ }
432
457
433
458
template <__enable_if_t <__is_allocator<_Allocator>::value, int > = 0 >
434
459
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
@@ -1125,39 +1150,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::__append(size_type _
1125
1150
}
1126
1151
}
1127
1152
1128
- template <class _Tp , class _Allocator >
1129
- _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<_Tp, _Allocator>::vector(size_type __n) {
1130
- auto __guard = std::__make_exception_guard (__destroy_vector (*this ));
1131
- if (__n > 0 ) {
1132
- __vallocate (__n);
1133
- __construct_at_end (__n);
1134
- }
1135
- __guard.__complete ();
1136
- }
1137
-
1138
- #if _LIBCPP_STD_VER >= 14
1139
- template <class _Tp , class _Allocator >
1140
- _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a)
1141
- : __end_cap_(nullptr , __a) {
1142
- auto __guard = std::__make_exception_guard (__destroy_vector (*this ));
1143
- if (__n > 0 ) {
1144
- __vallocate (__n);
1145
- __construct_at_end (__n);
1146
- }
1147
- __guard.__complete ();
1148
- }
1149
- #endif
1150
-
1151
- template <class _Tp , class _Allocator >
1152
- _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x) {
1153
- auto __guard = std::__make_exception_guard (__destroy_vector (*this ));
1154
- if (__n > 0 ) {
1155
- __vallocate (__n);
1156
- __construct_at_end (__n, __x);
1157
- }
1158
- __guard.__complete ();
1159
- }
1160
-
1161
1153
template <class _Tp , class _Allocator >
1162
1154
template <class _InputIterator ,
1163
1155
__enable_if_t <__has_exactly_input_iterator_category<_InputIterator>::value &&
0 commit comments