diff options
| author | Howard Hinnant <hhinnant@apple.com> | 2010-09-04 23:28:19 +0000 |
|---|---|---|
| committer | Howard Hinnant <hhinnant@apple.com> | 2010-09-04 23:28:19 +0000 |
| commit | 7609c9b665d67c9738fdd0af53ba9e8782218542 (patch) | |
| tree | 79269b65cc775b7f08160aca8f688ba04e0bfe86 /libcxx/include/stack | |
| parent | edbdff64c720d143b5ae7ace2733256b51be8bb9 (diff) | |
| download | bcm5719-llvm-7609c9b665d67c9738fdd0af53ba9e8782218542.tar.gz bcm5719-llvm-7609c9b665d67c9738fdd0af53ba9e8782218542.zip | |
Changed __config to react to all of clang's currently documented has_feature flags, and renamed _LIBCPP_MOVE to _LIBCPP_HAS_NO_RVALUE_REFERENCES to be more consistent with the rest of the libc++'s flags, and with clang's nomenclature.
llvm-svn: 113086
Diffstat (limited to 'libcxx/include/stack')
| -rw-r--r-- | libcxx/include/stack | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libcxx/include/stack b/libcxx/include/stack index f4be79bf7d6..7737379547f 100644 --- a/libcxx/include/stack +++ b/libcxx/include/stack @@ -107,11 +107,11 @@ protected: public: stack() : c() {} explicit stack(const container_type& __c) : c(__c) {} -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES explicit stack(container_type&& __c) : c(_STD::move(__c)) {} stack(stack&& __s) : c(_STD::move(__s.c)) {} stack& operator=(stack&& __s) {c = _STD::move(__s.c); return *this;} -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Alloc> explicit stack(const _Alloc& __a, typename enable_if<uses_allocator<container_type, @@ -127,7 +127,7 @@ public: typename enable_if<uses_allocator<container_type, _Alloc>::value>::type* = 0) : c(__s.c, __a) {} -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Alloc> stack(container_type&& __c, const _Alloc& __a, typename enable_if<uses_allocator<container_type, @@ -138,7 +138,7 @@ public: typename enable_if<uses_allocator<container_type, _Alloc>::value>::type* = 0) : c(_STD::move(__s.c), __a) {} -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES bool empty() const {return c.empty();} size_type size() const {return c.size();} @@ -146,11 +146,13 @@ public: const_reference top() const {return c.back();} void push(const value_type& __v) {c.push_back(__v);} -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES void push(value_type&& __v) {c.push_back(_STD::move(__v));} +#ifndef _LIBCPP_HAS_NO_VARIADICS template <class... _Args> void emplace(_Args&&... __args) {c.emplace_back(_STD::forward<_Args>(__args)...);} -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES void pop() {c.pop_back();} void swap(stack& __s) |

