From a5b2dbc259e289ea23fe9aebb34eba2c1dc7fefb Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 29 Jan 2014 19:30:27 +0000 Subject: Vendor import of libc++ tags/RELEASE_34/final r197960: https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_34/final@197960 --- include/array | 59 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 29 deletions(-) (limited to 'include/array') diff --git a/include/array b/include/array index bcf53478677e..d37075da1a2a 100644 --- a/include/array +++ b/include/array @@ -59,14 +59,14 @@ struct array // element access: reference operator[](size_type n); - const_reference operator[](size_type n) const; - const_reference at(size_type n) const; + const_reference operator[](size_type n) const; // constexpr in C++14 + const_reference at(size_type n) const; // constexpr in C++14 reference at(size_type n); reference front(); - const_reference front() const; + const_reference front() const; // constexpr in C++14 reference back(); - const_reference back() const; + const_reference back() const; // constexpr in C++14 T* data() noexcept; const T* data() const noexcept; @@ -92,9 +92,9 @@ template class tuple_size; template class tuple_element; template struct tuple_size>; template struct tuple_element>; -template T& get(array&) noexcept; -template const T& get(const array&) noexcept; -template T&& get(array&&) noexcept; +template T& get(array&) noexcept; // constexpr in C++14 +template const T& get(const array&) noexcept; // constexpr in C++14 +template T&& get(array&&) noexcept; // constexpr in C++14 } // std @@ -118,7 +118,7 @@ template T&& get(array&&) noexcept; _LIBCPP_BEGIN_NAMESPACE_STD template -struct _LIBCPP_TYPE_VIS array +struct _LIBCPP_TYPE_VIS_ONLY array { // types: typedef array __self; @@ -181,14 +181,14 @@ struct _LIBCPP_TYPE_VIS array // element access: _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) {return __elems_[__n];} - _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __n) const {return __elems_[__n];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference operator[](size_type __n) const {return __elems_[__n];} reference at(size_type __n); - const_reference at(size_type __n) const; + _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference at(size_type __n) const; _LIBCPP_INLINE_VISIBILITY reference front() {return __elems_[0];} - _LIBCPP_INLINE_VISIBILITY const_reference front() const {return __elems_[0];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference front() const {return __elems_[0];} _LIBCPP_INLINE_VISIBILITY reference back() {return __elems_[_Size > 0 ? _Size-1 : 0];} - _LIBCPP_INLINE_VISIBILITY const_reference back() const {return __elems_[_Size > 0 ? _Size-1 : 0];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const {return __elems_[_Size > 0 ? _Size-1 : 0];} _LIBCPP_INLINE_VISIBILITY value_type* data() _NOEXCEPT {return __elems_;} @@ -210,6 +210,7 @@ array<_Tp, _Size>::at(size_type __n) } template +_LIBCPP_CONSTEXPR_AFTER_CXX11 typename array<_Tp, _Size>::const_reference array<_Tp, _Size>::at(size_type __n) const { @@ -223,7 +224,7 @@ array<_Tp, _Size>::at(size_type __n) const } template -_LIBCPP_INLINE_VISIBILITY inline +inline _LIBCPP_INLINE_VISIBILITY bool operator==(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) { @@ -231,7 +232,7 @@ operator==(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) } template -_LIBCPP_INLINE_VISIBILITY inline +inline _LIBCPP_INLINE_VISIBILITY bool operator!=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) { @@ -239,7 +240,7 @@ operator!=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) } template -_LIBCPP_INLINE_VISIBILITY inline +inline _LIBCPP_INLINE_VISIBILITY bool operator<(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) { @@ -247,7 +248,7 @@ operator<(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) } template -_LIBCPP_INLINE_VISIBILITY inline +inline _LIBCPP_INLINE_VISIBILITY bool operator>(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) { @@ -255,7 +256,7 @@ operator>(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) } template -_LIBCPP_INLINE_VISIBILITY inline +inline _LIBCPP_INLINE_VISIBILITY bool operator<=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) { @@ -263,7 +264,7 @@ operator<=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) } template -_LIBCPP_INLINE_VISIBILITY inline +inline _LIBCPP_INLINE_VISIBILITY bool operator>=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) { @@ -271,7 +272,7 @@ operator>=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) } template -_LIBCPP_INLINE_VISIBILITY inline +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_swappable<_Tp>::value, @@ -284,54 +285,54 @@ swap(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) } template -class _LIBCPP_TYPE_VIS tuple_size > +class _LIBCPP_TYPE_VIS_ONLY tuple_size > : public integral_constant {}; template -class _LIBCPP_TYPE_VIS tuple_size > +class _LIBCPP_TYPE_VIS_ONLY tuple_size > : public integral_constant {}; template -class _LIBCPP_TYPE_VIS tuple_element<_Ip, array<_Tp, _Size> > +class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, array<_Tp, _Size> > { public: typedef _Tp type; }; template -class _LIBCPP_TYPE_VIS tuple_element<_Ip, const array<_Tp, _Size> > +class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, const array<_Tp, _Size> > { public: typedef const _Tp type; }; template -_LIBCPP_INLINE_VISIBILITY inline +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _Tp& get(array<_Tp, _Size>& __a) _NOEXCEPT { static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array)"); - return __a[_Ip]; + return __a.__elems_[_Ip]; } template -_LIBCPP_INLINE_VISIBILITY inline +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 __a[_Ip]; + return __a.__elems_[_Ip]; } #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template -_LIBCPP_INLINE_VISIBILITY inline +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _Tp&& get(array<_Tp, _Size>&& __a) _NOEXCEPT { static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array &&)"); - return _VSTD::move(__a[_Ip]); + return _VSTD::move(__a.__elems_[_Ip]); } #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -- cgit v1.3