diff options
author | Howard Hinnant <hhinnant@apple.com> | 2010-11-17 22:52:17 +0300 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2010-11-17 22:52:17 +0300 |
commit | 601afb30ec6ea4171acd812290e79ac49bdd19c5 (patch) | |
tree | a7e0c4f4581b3c6d66c52a3515138cf0feb43297 /libcxx/include/array | |
parent | eebbbeb917efe74be9e8181ebf113671f7622ef5 (diff) |
LWG 1191
llvm-svn: 119545
Diffstat (limited to 'libcxx/include/array')
-rw-r--r-- | libcxx/include/array | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libcxx/include/array b/libcxx/include/array index 2c3d89cde9d5..3801262297f8 100644 --- a/libcxx/include/array +++ b/libcxx/include/array @@ -94,6 +94,7 @@ template <class T, size_t N> struct tuple_size<array<T, N>>; template <int I, class T, size_t N> struct tuple_element<I, array<T, N>>; template <int I, class T, size_t N> T& get(array<T, N>&); template <int I, class T, size_t N> const T& get(const array<T, N>&); +template <int I, class T, size_t N> T&& get(array<T, N>&&); } // std @@ -295,6 +296,18 @@ get(const array<_Tp, _Size>& __a) return __a[_Ip]; } +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + +template <size_t _Ip, class _Tp, size_t _Size> +_LIBCPP_INLINE_VISIBILITY inline +_Tp&& +get(array<_Tp, _Size>&& __a) +{ + return _STD::move(__a[_Ip]); +} + +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_ARRAY |