From 66a14d151efb8d142e23f88166e76bfe3730adda Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Mon, 1 Jun 2020 16:28:44 -0400 Subject: [PATCH] [libc++] NFC: Minor refactoring in std::array --- libcxx/include/array | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libcxx/include/array b/libcxx/include/array index 6874377..6cd4d19 100644 --- a/libcxx/include/array +++ b/libcxx/include/array @@ -150,12 +150,12 @@ struct _LIBCPP_TEMPLATE_VIS array // No explicit construct/copy/destroy for aggregate type _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void fill(const value_type& __u) { - _VSTD::fill_n(__elems_, _Size, __u); + _VSTD::fill_n(data(), _Size, __u); } _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) { - std::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_); + std::swap_ranges(data(), data() + _Size, __a.data()); } // iterators: @@ -192,7 +192,7 @@ struct _LIBCPP_TEMPLATE_VIS array _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT {return _Size;} _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY - _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return false; } + _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return _Size == 0;} // element access: _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 -- 2.7.4