summaryrefslogtreecommitdiffstats
path: root/libcxx/include/stack
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2018-05-22 01:57:53 +0000
committerMarshall Clow <mclow.lists@gmail.com>2018-05-22 01:57:53 +0000
commit5b8b8b5dce587f1e5a4a31cc24f09b18bd53ff9a (patch)
tree8f04be8d8eaf76d4e17086a1c1d3993a4beab9fa /libcxx/include/stack
parent2d3eaeb2d485c464d493db9d301a2dd7e9d8d57c (diff)
downloadbcm5719-llvm-5b8b8b5dce587f1e5a4a31cc24f09b18bd53ff9a.tar.gz
bcm5719-llvm-5b8b8b5dce587f1e5a4a31cc24f09b18bd53ff9a.zip
Deduction guides for the container adaptors - queue, stack, and priority_queue
llvm-svn: 332927
Diffstat (limited to 'libcxx/include/stack')
-rw-r--r--libcxx/include/stack22
1 files changed, 22 insertions, 0 deletions
diff --git a/libcxx/include/stack b/libcxx/include/stack
index 7b81ade1f5d..2b3f8aea19e 100644
--- a/libcxx/include/stack
+++ b/libcxx/include/stack
@@ -61,6 +61,12 @@ public:
void swap(stack& c) noexcept(is_nothrow_swappable_v<Container>)
};
+template<class Container>
+ stack(Container) -> stack<typename Container::value_type, Container>; // C++17
+
+template<class Container, class Allocator>
+ stack(Container, Allocator) -> stack<typename Container::value_type, Container>; // C++17
+
template <class T, class Container>
bool operator==(const stack<T, Container>& x, const stack<T, Container>& y);
template <class T, class Container>
@@ -229,6 +235,22 @@ public:
operator< (const stack<T1, _C1>& __x, const stack<T1, _C1>& __y);
};
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+template<class _Container,
+ class = typename enable_if<!__is_allocator<_Container>::value, nullptr_t>::type
+>
+stack(_Container)
+ -> stack<typename _Container::value_type, _Container>;
+
+template<class _Container,
+ class _Alloc,
+ class = typename enable_if<!__is_allocator<_Container>::value, nullptr_t>::type,
+ class = typename enable_if< __is_allocator<_Alloc>::value, nullptr_t>::type
+ >
+stack(_Container, _Alloc)
+ -> stack<typename _Container::value_type, _Container>;
+#endif
+
template <class _Tp, class _Container>
inline _LIBCPP_INLINE_VISIBILITY
bool
OpenPOWER on IntegriCloud