summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/stack
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libc++/include/stack')
-rw-r--r--contrib/libc++/include/stack17
1 files changed, 11 insertions, 6 deletions
diff --git a/contrib/libc++/include/stack b/contrib/libc++/include/stack
index 48b3b0d..c797ea5 100644
--- a/contrib/libc++/include/stack
+++ b/contrib/libc++/include/stack
@@ -55,7 +55,7 @@ public:
void push(const value_type& x);
void push(value_type&& x);
- template <class... Args> void emplace(Args&&... args);
+ template <class... Args> reference emplace(Args&&... args); // reference in C++17
void pop();
void swap(stack& c) noexcept(is_nothrow_swappable_v<Container>)
@@ -91,7 +91,7 @@ template <class T, class Container>
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp, class _Container = deque<_Tp> > class _LIBCPP_TYPE_VIS_ONLY stack;
+template <class _Tp, class _Container = deque<_Tp> > class _LIBCPP_TEMPLATE_VIS stack;
template <class _Tp, class _Container>
_LIBCPP_INLINE_VISIBILITY
@@ -104,7 +104,7 @@ bool
operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);
template <class _Tp, class _Container /*= deque<_Tp>*/>
-class _LIBCPP_TYPE_VIS_ONLY stack
+class _LIBCPP_TEMPLATE_VIS stack
{
public:
typedef _Container container_type;
@@ -199,8 +199,13 @@ public:
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
- void emplace(_Args&&... __args)
- {c.emplace_back(_VSTD::forward<_Args>(__args)...);}
+#if _LIBCPP_STD_VER > 14
+ reference emplace(_Args&&... __args)
+ { return c.emplace_back(_VSTD::forward<_Args>(__args)...);}
+#else
+ void emplace(_Args&&... __args)
+ { c.emplace_back(_VSTD::forward<_Args>(__args)...);}
+#endif
#endif // _LIBCPP_HAS_NO_VARIADICS
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
@@ -286,7 +291,7 @@ swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y)
}
template <class _Tp, class _Container, class _Alloc>
-struct _LIBCPP_TYPE_VIS_ONLY uses_allocator<stack<_Tp, _Container>, _Alloc>
+struct _LIBCPP_TEMPLATE_VIS uses_allocator<stack<_Tp, _Container>, _Alloc>
: public uses_allocator<_Container, _Alloc>
{
};
OpenPOWER on IntegriCloud