libstdc++: Add C++20 P1032 constexpr to _GLIBCXX_DEBUG array

* include/debug/array (array<>::fill): Add C++20 constexpr.
	(array<>::swap): Likewise.

From-SVN: r278718
This commit is contained in:
François Dumont 2019-11-26 06:12:34 +00:00
parent db58c8e919
commit 59d37e9709
2 changed files with 6 additions and 2 deletions

View file

@ -1,5 +1,8 @@
2019-11-26 François Dumont <fdumont@gcc.gnu.org>
* include/debug/array (array<>::fill): Add C++20 constexpr.
(array<>::swap): Likewise.
* include/debug/safe_iterator.h
[__cpp_lib_concepts](_Safe_iterator<>::iterator_concept): Define for
C++20.

View file

@ -80,11 +80,11 @@ namespace __debug
// No explicit construct/copy/destroy for aggregate type.
// DR 776.
void
_GLIBCXX20_CONSTEXPR void
fill(const value_type& __u)
{ std::fill_n(begin(), size(), __u); }
void
_GLIBCXX20_CONSTEXPR void
swap(array& __other)
noexcept(_AT_Type::_Is_nothrow_swappable::value)
{ std::swap_ranges(begin(), end(), __other.begin()); }
@ -282,6 +282,7 @@ namespace __debug
#endif
template<typename _Tp, std::size_t _Nm>
_GLIBCXX20_CONSTEXPR
inline void
swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
noexcept(noexcept(__one.swap(__two)))