git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119545 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2010-11-17 19:52:17 +00:00
parent 86ed8aefb2
commit cd2254b454
7 changed files with 164 additions and 0 deletions

View File

@@ -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