array (241900) | array (246468) |
---|---|
1// -*- C++ -*- 2//===---------------------------- array -----------------------------------===// 3// 4// The LLVM Compiler Infrastructure 5// 6// This file is dual licensed under the MIT and the University of Illinois Open 7// Source Licenses. See LICENSE.TXT for details. 8// --- 296 unchanged lines hidden (view full) --- 305 typedef const _Tp type; 306}; 307 308template <size_t _Ip, class _Tp, size_t _Size> 309_LIBCPP_INLINE_VISIBILITY inline 310_Tp& 311get(array<_Tp, _Size>& __a) _NOEXCEPT 312{ | 1// -*- C++ -*- 2//===---------------------------- array -----------------------------------===// 3// 4// The LLVM Compiler Infrastructure 5// 6// This file is dual licensed under the MIT and the University of Illinois Open 7// Source Licenses. See LICENSE.TXT for details. 8// --- 296 unchanged lines hidden (view full) --- 305 typedef const _Tp type; 306}; 307 308template <size_t _Ip, class _Tp, size_t _Size> 309_LIBCPP_INLINE_VISIBILITY inline 310_Tp& 311get(array<_Tp, _Size>& __a) _NOEXCEPT 312{ |
313 static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array)"); |
|
313 return __a[_Ip]; 314} 315 316template <size_t _Ip, class _Tp, size_t _Size> 317_LIBCPP_INLINE_VISIBILITY inline 318const _Tp& 319get(const array<_Tp, _Size>& __a) _NOEXCEPT 320{ | 314 return __a[_Ip]; 315} 316 317template <size_t _Ip, class _Tp, size_t _Size> 318_LIBCPP_INLINE_VISIBILITY inline 319const _Tp& 320get(const array<_Tp, _Size>& __a) _NOEXCEPT 321{ |
322 static_assert(_Ip < _Size, "Index out of bounds in std::get<> (const std::array)"); |
|
321 return __a[_Ip]; 322} 323 324#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 325 326template <size_t _Ip, class _Tp, size_t _Size> 327_LIBCPP_INLINE_VISIBILITY inline 328_Tp&& 329get(array<_Tp, _Size>&& __a) _NOEXCEPT 330{ | 323 return __a[_Ip]; 324} 325 326#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 327 328template <size_t _Ip, class _Tp, size_t _Size> 329_LIBCPP_INLINE_VISIBILITY inline 330_Tp&& 331get(array<_Tp, _Size>&& __a) _NOEXCEPT 332{ |
333 static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array &&)"); |
|
331 return _VSTD::move(__a[_Ip]); 332} 333 334#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 335 336_LIBCPP_END_NAMESPACE_STD 337 338#endif // _LIBCPP_ARRAY | 334 return _VSTD::move(__a[_Ip]); 335} 336 337#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 338 339_LIBCPP_END_NAMESPACE_STD 340 341#endif // _LIBCPP_ARRAY |