diff options
| author | Eric Fiselier <eric@efcs.ca> | 2015-12-18 00:36:55 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2015-12-18 00:36:55 +0000 |
| commit | 545b8861fc40bb194d6e8daa382f9d6d4659a13b (patch) | |
| tree | f63a326f7a064e5ddcf73e29c3897e879a4de439 /libcxx/include/array | |
| parent | d7c0b73556faab45eda3eb1cc56ae53d8cbae48a (diff) | |
| download | bcm5719-llvm-545b8861fc40bb194d6e8daa382f9d6d4659a13b.tar.gz bcm5719-llvm-545b8861fc40bb194d6e8daa382f9d6d4659a13b.zip | |
[libcxx] LWG2485: get() should be overloaded for const tuple&&. Patch from K-Ballo.
Review: http://reviews.llvm.org/D14839
llvm-svn: 255941
Diffstat (limited to 'libcxx/include/array')
| -rw-r--r-- | libcxx/include/array | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libcxx/include/array b/libcxx/include/array index 36096905196..8866eaf6b46 100644 --- a/libcxx/include/array +++ b/libcxx/include/array @@ -95,6 +95,7 @@ template <size_t I, class T, size_t N> struct tuple_element<I, array<T, N>>; template <size_t I, class T, size_t N> T& get(array<T, N>&) noexcept; // constexpr in C++14 template <size_t I, class T, size_t N> const T& get(const array<T, N>&) noexcept; // constexpr in C++14 template <size_t I, class T, size_t N> T&& get(array<T, N>&&) noexcept; // constexpr in C++14 +template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexcept; // constexpr in C++14 } // std @@ -324,6 +325,15 @@ get(array<_Tp, _Size>&& __a) _NOEXCEPT return _VSTD::move(__a.__elems_[_Ip]); } +template <size_t _Ip, class _Tp, size_t _Size> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +const _Tp&& +get(const array<_Tp, _Size>&& __a) _NOEXCEPT +{ + static_assert(_Ip < _Size, "Index out of bounds in std::get<> (const std::array &&)"); + return _VSTD::move(__a.__elems_[_Ip]); +} + #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_END_NAMESPACE_STD |

