diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2018-05-18 21:01:04 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2018-05-18 21:01:04 +0000 |
| commit | 0ca8c0895c6034615593c295dd955f29b25bf3d4 (patch) | |
| tree | 5c0e1149ee70ba11d5440e4e719116acf5ee4194 /libcxx/include | |
| parent | 29e02657322f0cdfaefce0ae2d29f3e02ba0a3cc (diff) | |
| download | bcm5719-llvm-0ca8c0895c6034615593c295dd955f29b25bf3d4.tar.gz bcm5719-llvm-0ca8c0895c6034615593c295dd955f29b25bf3d4.zip | |
Implement deduction guides for <array>; Reviewed as https://reviews.llvm.org/D46964
llvm-svn: 332768
Diffstat (limited to 'libcxx/include')
| -rw-r--r-- | libcxx/include/array | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libcxx/include/array b/libcxx/include/array index fdb1f9dae53..1e6a650198b 100644 --- a/libcxx/include/array +++ b/libcxx/include/array @@ -72,6 +72,9 @@ struct array const T* data() const noexcept; }; + template <class T, class... U> + array(T, U...) -> array<T, 1 + sizeof...(U)>; + template <class T, size_t N> bool operator==(const array<T,N>& x, const array<T,N>& y); template <class T, size_t N> @@ -86,7 +89,7 @@ template <class T, size_t N> bool operator>=(const array<T,N>& x, const array<T,N>& y); template <class T, size_t N > - void swap(array<T,N>& x, array<T,N>& y) noexcept(noexcept(x.swap(y))); + void swap(array<T,N>& x, array<T,N>& y) noexcept(noexcept(x.swap(y))); // C++17 template <class T> class tuple_size; template <size_t I, class T> class tuple_element; @@ -354,6 +357,14 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> }; +#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES +template<class _Tp, class... _Args, + class = typename enable_if<(is_same_v<_Tp, _Args> && ...), void>::type + > +array(_Tp, _Args...) + -> array<_Tp, 1 + sizeof...(_Args)>; +#endif + template <class _Tp, size_t _Size> inline _LIBCPP_INLINE_VISIBILITY bool |

