diff --git a/libcxx/include/vector b/libcxx/include/vector --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -439,7 +439,7 @@ _LIBCPP_INLINE_VISIBILITY vector(vector&& __x) #if _LIBCPP_STD_VER > 14 - _NOEXCEPT; + noexcept; #else _NOEXCEPT_(is_nothrow_move_constructible::value); #endif @@ -567,41 +567,26 @@ const value_type* data() const _NOEXCEPT {return _VSTD::__to_address(this->__begin_);} -#ifdef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY - void __emplace_back(const value_type& __x) { push_back(__x); } -#else - template - _LIBCPP_INLINE_VISIBILITY - void __emplace_back(_Arg&& __arg) { - emplace_back(_VSTD::forward<_Arg>(__arg)); - } -#endif - _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x); -#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x); template - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY #if _LIBCPP_STD_VER > 14 reference emplace_back(_Args&&... __args); #else void emplace_back(_Args&&... __args); #endif -#endif // !_LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void pop_back(); iterator insert(const_iterator __position, const_reference __x); -#ifndef _LIBCPP_CXX03_LANG iterator insert(const_iterator __position, value_type&& __x); template - iterator emplace(const_iterator __position, _Args&&... __args); -#endif // !_LIBCPP_CXX03_LANG + iterator emplace(const_iterator __position, _Args&&... __args); iterator insert(const_iterator __position, size_type __n, const_reference __x); template @@ -727,7 +712,6 @@ __annotate_shrink(__old_size); } -#ifndef _LIBCPP_CXX03_LANG template _LIBCPP_INLINE_VISIBILITY inline void __push_back_slow_path(_Up&& __x); @@ -735,11 +719,6 @@ template _LIBCPP_INLINE_VISIBILITY inline void __emplace_back_slow_path(_Args&&... __args); -#else - template - _LIBCPP_INLINE_VISIBILITY - inline void __push_back_slow_path(_Up& __x); -#endif // The following functions are no-ops outside of AddressSanitizer mode. // We call annotatations only for the default Allocator because other allocators @@ -1113,7 +1092,7 @@ { _VSTD::__debug_db_insert_c(this); for (; __first != __last; ++__first) - __emplace_back(*__first); + emplace_back(*__first); } template @@ -1128,7 +1107,7 @@ { _VSTD::__debug_db_insert_c(this); for (; __first != __last; ++__first) - __emplace_back(*__first); + emplace_back(*__first); } template @@ -1193,13 +1172,11 @@ } } -#ifndef _LIBCPP_CXX03_LANG - template inline _LIBCPP_INLINE_VISIBILITY vector<_Tp, _Allocator>::vector(vector&& __x) #if _LIBCPP_STD_VER > 14 - _NOEXCEPT + noexcept #else _NOEXCEPT_(is_nothrow_move_constructible::value) #endif @@ -1238,6 +1215,8 @@ } } +#ifndef _LIBCPP_CXX03_LANG + template inline _LIBCPP_INLINE_VISIBILITY vector<_Tp, _Allocator>::vector(initializer_list __il) @@ -1263,6 +1242,8 @@ } } +#endif // _LIBCPP_CXX03_LANG + template inline _LIBCPP_INLINE_VISIBILITY vector<_Tp, _Allocator>& @@ -1304,8 +1285,6 @@ #endif } -#endif // !_LIBCPP_CXX03_LANG - template inline _LIBCPP_INLINE_VISIBILITY vector<_Tp, _Allocator>& @@ -1334,7 +1313,7 @@ { clear(); for (; __first != __last; ++__first) - __emplace_back(*__first); + emplace_back(*__first); } template @@ -1528,11 +1507,7 @@ template template void -#ifndef _LIBCPP_CXX03_LANG vector<_Tp, _Allocator>::__push_back_slow_path(_Up&& __x) -#else -vector<_Tp, _Allocator>::__push_back_slow_path(_Up& __x) -#endif { allocator_type& __a = this->__alloc(); __split_buffer __v(__recommend(size() + 1), size(), __a); @@ -1555,8 +1530,6 @@ __push_back_slow_path(__x); } -#ifndef _LIBCPP_CXX03_LANG - template inline _LIBCPP_INLINE_VISIBILITY void @@ -1604,8 +1577,6 @@ #endif } -#endif // !_LIBCPP_CXX03_LANG - template inline void @@ -1702,8 +1673,6 @@ return __make_iter(__p); } -#ifndef _LIBCPP_CXX03_LANG - template typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x) @@ -1764,8 +1733,6 @@ return __make_iter(__p); } -#endif // !_LIBCPP_CXX03_LANG - template typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_reference __x) @@ -2147,10 +2114,16 @@ vector(initializer_list __il); vector(initializer_list __il, const allocator_type& __a); + _LIBCPP_INLINE_VISIBILITY + vector& operator=(initializer_list __il) + {assign(__il.begin(), __il.end()); return *this;} + +#endif // !_LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY vector(vector&& __v) #if _LIBCPP_STD_VER > 14 - _NOEXCEPT; + noexcept; #else _NOEXCEPT_(is_nothrow_move_constructible::value); #endif @@ -2159,12 +2132,6 @@ vector& operator=(vector&& __v) _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value)); - _LIBCPP_INLINE_VISIBILITY - vector& operator=(initializer_list __il) - {assign(__il.begin(), __il.end()); return *this;} - -#endif // !_LIBCPP_CXX03_LANG - template typename enable_if < @@ -2769,8 +2736,6 @@ return *this; } -#ifndef _LIBCPP_CXX03_LANG - template inline _LIBCPP_INLINE_VISIBILITY vector::vector(vector&& __v) #if _LIBCPP_STD_VER > 14 @@ -2842,8 +2807,6 @@ __c.__cap() = __c.__size_ = 0; } -#endif // !_LIBCPP_CXX03_LANG - template void vector::assign(size_type __n, const value_type& __x) diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp --- a/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 - // // vector& operator=(vector&& c); diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp --- a/libcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp @@ -8,8 +8,6 @@ // Make sure that a std::vector containing move-only types can't be copied. -// UNSUPPORTED: c++03 - #include struct move_only diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/move.addressof.compile.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/move.addressof.compile.pass.cpp --- a/libcxx/test/std/containers/sequences/vector/vector.cons/move.addressof.compile.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.cons/move.addressof.compile.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 - // // vector(vector&& c); diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp --- a/libcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 - // // vector(vector&& c); diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp --- a/libcxx/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 - // // vector(vector&& c, const allocator_type& a); diff --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.addressof.compile.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.addressof.compile.pass.cpp --- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.addressof.compile.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.addressof.compile.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 - // // template iterator emplace(const_iterator pos, Args&&... args); diff --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp --- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 - // // template iterator emplace(const_iterator pos, Args&&... args); diff --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp --- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 - // // template reference emplace_back(Args&&... args); diff --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.addressof.compile.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.addressof.compile.pass.cpp --- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.addressof.compile.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.addressof.compile.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 - // // iterator insert(const_iterator position, value_type&& x); diff --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp --- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 - // // iterator insert(const_iterator position, value_type&& x); diff --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp --- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 - // // void push_back(value_type&& x); diff --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/resize_not_move_insertable.fail.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/resize_not_move_insertable.fail.cpp --- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/resize_not_move_insertable.fail.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/resize_not_move_insertable.fail.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 - // // Test that vector produces a decent diagnostic for user types that explicitly