diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2018-05-18 23:44:13 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2018-05-18 23:44:13 +0000 |
| commit | dbb6f8a8179b0604e25707b5c1b72be6164f62d9 (patch) | |
| tree | 8e8850ac9cb55bb80dffdd28e23783cc3f87dfa0 /libcxx/include | |
| parent | 2ada2499eafb190d4910ff97644ae47198fb0321 (diff) | |
| download | bcm5719-llvm-dbb6f8a8179b0604e25707b5c1b72be6164f62d9.tar.gz bcm5719-llvm-dbb6f8a8179b0604e25707b5c1b72be6164f62d9.zip | |
Implement deduction guides for <deque>
llvm-svn: 332785
Diffstat (limited to 'libcxx/include')
| -rw-r--r-- | libcxx/include/deque | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/libcxx/include/deque b/libcxx/include/deque index 08cb295408b..bfbd3a5ef54 100644 --- a/libcxx/include/deque +++ b/libcxx/include/deque @@ -128,6 +128,10 @@ public: void clear() noexcept; }; +template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> + deque(InputIterator, InputIterator, Allocator = Allocator()) + -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>; + template <class T, class Allocator> bool operator==(const deque<T,Allocator>& x, const deque<T,Allocator>& y); template <class T, class Allocator> @@ -921,13 +925,14 @@ class __deque_base { __deque_base(const __deque_base& __c); __deque_base& operator=(const __deque_base& __c); -protected: - typedef _Tp value_type; +public: typedef _Allocator allocator_type; typedef allocator_traits<allocator_type> __alloc_traits; + typedef typename __alloc_traits::size_type size_type; +protected: + typedef _Tp value_type; typedef value_type& reference; typedef const value_type& const_reference; - typedef typename __alloc_traits::size_type size_type; typedef typename __alloc_traits::difference_type difference_type; typedef typename __alloc_traits::pointer pointer; typedef typename __alloc_traits::const_pointer const_pointer; @@ -946,6 +951,7 @@ protected: typedef __deque_iterator<value_type, const_pointer, const_reference, __map_const_pointer, difference_type> const_iterator; +protected: __map __map_; size_type __start_; __compressed_pair<size_type, allocator_type> __size_; @@ -1461,6 +1467,23 @@ private: void __move_assign(deque& __c, false_type); }; +#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES +template<class _InputIterator, + class _Alloc = typename std::allocator<typename iterator_traits<_InputIterator>::value_type>, + class = typename enable_if<__is_allocator<_Alloc>::value, void>::type + > +deque(_InputIterator, _InputIterator) + -> deque<typename iterator_traits<_InputIterator>::value_type, _Alloc>; + +template<class _InputIterator, + class _Alloc, + class = typename enable_if<__is_allocator<_Alloc>::value, void>::type + > +deque(_InputIterator, _InputIterator, _Alloc) + -> deque<typename iterator_traits<_InputIterator>::value_type, _Alloc>; +#endif + + template <class _Tp, class _Allocator> deque<_Tp, _Allocator>::deque(size_type __n) { |

