aboutsummaryrefslogtreecommitdiffstats
path: root/include/deque
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-29 20:59:02 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-29 20:59:02 +0000
commit3efcd4e54b8b374c90b362d763a726b9e025efae (patch)
tree11dad958946a61a8fc5051e9e9453d98a2742421 /include/deque
parent90c3c6c2a0a0afd28cbb5e117b278bdcdebfd85f (diff)
downloadsrc-3efcd4e54b8b374c90b362d763a726b9e025efae.tar.gz
src-3efcd4e54b8b374c90b362d763a726b9e025efae.zip
Vendor import of libc++ release_40 branch r293443:vendor/libc++/libc++-release_40-r293443
Notes
Notes: svn path=/vendor/libc++/dist/; revision=312962 svn path=/vendor/libc++/libc++-release_40-r293443/; revision=312963; tag=vendor/libc++/libc++-release_40-r293443
Diffstat (limited to 'include/deque')
-rw-r--r--include/deque23
1 files changed, 20 insertions, 3 deletions
diff --git a/include/deque b/include/deque
index 0454162a8f73..92801540f2e7 100644
--- a/include/deque
+++ b/include/deque
@@ -110,8 +110,8 @@ public:
void push_front(value_type&& v);
void push_back(const value_type& v);
void push_back(value_type&& v);
- template <class... Args> reference emplace_front(Args&&... args);
- template <class... Args> reference emplace_back(Args&&... args);
+ template <class... Args> reference emplace_front(Args&&... args); // reference in C++17
+ template <class... Args> reference emplace_back(Args&&... args); // reference in C++17
template <class... Args> iterator emplace(const_iterator p, Args&&... args);
iterator insert(const_iterator p, const value_type& v);
iterator insert(const_iterator p, value_type&& v);
@@ -1342,8 +1342,13 @@ public:
void push_back(const value_type& __v);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_VARIADICS
+#if _LIBCPP_STD_VER > 14
template <class... _Args> reference emplace_front(_Args&&... __args);
- template <class... _Args> reference emplace_back(_Args&&... __args);
+ template <class... _Args> reference emplace_back (_Args&&... __args);
+#else
+ template <class... _Args> void emplace_front(_Args&&... __args);
+ template <class... _Args> void emplace_back (_Args&&... __args);
+#endif
template <class... _Args> iterator emplace(const_iterator __p, _Args&&... __args);
#endif // _LIBCPP_HAS_NO_VARIADICS
void push_front(value_type&& __v);
@@ -1822,7 +1827,11 @@ deque<_Tp, _Allocator>::push_back(value_type&& __v)
template <class _Tp, class _Allocator>
template <class... _Args>
+#if _LIBCPP_STD_VER > 14
typename deque<_Tp, _Allocator>::reference
+#else
+void
+#endif
deque<_Tp, _Allocator>::emplace_back(_Args&&... __args)
{
allocator_type& __a = __base::__alloc();
@@ -1832,7 +1841,9 @@ deque<_Tp, _Allocator>::emplace_back(_Args&&... __args)
__alloc_traits::construct(__a, _VSTD::addressof(*__base::end()),
_VSTD::forward<_Args>(__args)...);
++__base::size();
+#if _LIBCPP_STD_VER > 14
return *--__base::end();
+#endif
}
#endif // _LIBCPP_HAS_NO_VARIADICS
@@ -1870,7 +1881,11 @@ deque<_Tp, _Allocator>::push_front(value_type&& __v)
template <class _Tp, class _Allocator>
template <class... _Args>
+#if _LIBCPP_STD_VER > 14
typename deque<_Tp, _Allocator>::reference
+#else
+void
+#endif
deque<_Tp, _Allocator>::emplace_front(_Args&&... __args)
{
allocator_type& __a = __base::__alloc();
@@ -1880,7 +1895,9 @@ deque<_Tp, _Allocator>::emplace_front(_Args&&... __args)
__alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
--__base::__start_;
++__base::size();
+#if _LIBCPP_STD_VER > 14
return *__base::begin();
+#endif
}
#endif // _LIBCPP_HAS_NO_VARIADICS