diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2017-01-16 03:02:10 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2017-01-16 03:02:10 +0000 |
| commit | e78269506fe5209a64b8b956d5c12c58bf02fb56 (patch) | |
| tree | 24721e0f0d184a9d69f9b54503ec38ad71b4dd98 /libcxx/include/array | |
| parent | c9807c3370568e970fa3659c5e973b57afe78365 (diff) | |
| download | bcm5719-llvm-e78269506fe5209a64b8b956d5c12c58bf02fb56.tar.gz bcm5719-llvm-e78269506fe5209a64b8b956d5c12c58bf02fb56.zip | |
Implement the missing constexpr stuff in <array>. Fixes PR#31645.
llvm-svn: 292091
Diffstat (limited to 'libcxx/include/array')
| -rw-r--r-- | libcxx/include/array | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libcxx/include/array b/libcxx/include/array index eee9405dbef..165ffad6b8b 100644 --- a/libcxx/include/array +++ b/libcxx/include/array @@ -185,14 +185,17 @@ struct _LIBCPP_TEMPLATE_VIS array _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return _Size == 0;} // element access: - _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) {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); + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reference operator[](size_type __n) {return __elems_[__n];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + const_reference operator[](size_type __n) const {return __elems_[__n];} + + _LIBCPP_CONSTEXPR_AFTER_CXX14 reference at(size_type __n); _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference at(size_type __n) const; - _LIBCPP_INLINE_VISIBILITY reference front() {return __elems_[0];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference front() {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 _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() {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 _LIBCPP_CONSTEXPR_AFTER_CXX14 @@ -202,6 +205,7 @@ struct _LIBCPP_TEMPLATE_VIS array }; template <class _Tp, size_t _Size> +_LIBCPP_CONSTEXPR_AFTER_CXX14 typename array<_Tp, _Size>::reference array<_Tp, _Size>::at(size_type __n) { |

