constexpr applied to <array>.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@160564 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2012-07-20 19:20:49 +00:00
parent 03d7181b0e
commit 08bce1754d
2 changed files with 18 additions and 4 deletions

View File

@@ -55,7 +55,7 @@ struct array
// capacity:
constexpr size_type size() const noexcept;
constexpr size_type max_size() const noexcept;
bool empty() const noexcept;
constexpr bool empty() const noexcept;
// element access:
reference operator[](size_type n);
@@ -173,11 +173,11 @@ struct _LIBCPP_VISIBLE array
// capacity:
_LIBCPP_INLINE_VISIBILITY
/*constexpr*/ size_type size() const _NOEXCEPT {return _Size;}
_LIBCPP_CONSTEXPR size_type size() const _NOEXCEPT {return _Size;}
_LIBCPP_INLINE_VISIBILITY
/*constexpr*/ size_type max_size() const _NOEXCEPT {return _Size;}
_LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT {return _Size;}
_LIBCPP_INLINE_VISIBILITY
bool empty() const _NOEXCEPT {return _Size == 0;}
_LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return _Size == 0;}
// element access:
_LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) {return __elems_[__n];}