Implement LWG Issue #2187 (emplace_back and emplace for vector<bool>)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188333 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -216,8 +216,10 @@ public:
|
||||
const_reference back() const;
|
||||
|
||||
void push_back(const value_type& x);
|
||||
template <class... Args> void emplace_back(Args&&... args); // C++14
|
||||
void pop_back();
|
||||
|
||||
template <class... Args> iterator emplace(const_iterator position, Args&&... args); // C++14
|
||||
iterator insert(const_iterator position, const value_type& x);
|
||||
iterator insert(const_iterator position, size_type n, const value_type& x);
|
||||
template <class InputIterator>
|
||||
@@ -2221,8 +2223,20 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference back() const {return __make_ref(__size_ - 1);}
|
||||
|
||||
void push_back(const value_type& __x);
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY void emplace_back(_Args&&... __args)
|
||||
{ push_back ( value_type ( _VSTD::forward<_Args>(__args)... )); }
|
||||
#endif
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void pop_back() {--__size_;}
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY iterator emplace(const_iterator position, _Args&&... __args)
|
||||
{ return insert ( position, value_type ( _VSTD::forward<_Args>(__args)... )); }
|
||||
#endif
|
||||
|
||||
iterator insert(const_iterator __position, const value_type& __x);
|
||||
iterator insert(const_iterator __position, size_type __n, const value_type& __x);
|
||||
iterator insert(const_iterator __position, size_type __n, const_reference __x);
|
||||
|
Reference in New Issue
Block a user