diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2013-08-13 23:54:12 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2013-08-13 23:54:12 +0000 |
commit | 2d6e2834a8abcce862ef17c44f62e4de41662748 (patch) | |
tree | 7db044c71606a6337e318a5075b50c5e4534cbeb /libcxx/include/vector | |
parent | a802c3526bc896234e252460a086890a6a7749a0 (diff) | |
download | bcm5719-llvm-2d6e2834a8abcce862ef17c44f62e4de41662748.tar.gz bcm5719-llvm-2d6e2834a8abcce862ef17c44f62e4de41662748.zip |
Implement LWG Issue #2187 (emplace_back and emplace for vector<bool>)
llvm-svn: 188333
Diffstat (limited to 'libcxx/include/vector')
-rw-r--r-- | libcxx/include/vector | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libcxx/include/vector b/libcxx/include/vector index df143445fe7..0855e8b930e 100644 --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -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); |