diff options
author | François Dumont <fdumont@gcc.gnu.org> | 2019-11-26 06:12:34 +0000 |
---|---|---|
committer | François Dumont <fdumont@gcc.gnu.org> | 2019-11-26 06:12:34 +0000 |
commit | 75482d31fd8f51a8bd5342bae460cb31f7c22e45 (patch) | |
tree | 13963c7f4be93c91fc753b8cee2f629a99acf1a6 | |
parent | 283dd37673270e4ca5d3900f881b60526e3207f3 (diff) |
libstdc++: Add C++20 P1032 constexpr to _GLIBCXX_DEBUG array
* include/debug/array (array<>::fill): Add C++20 constexpr.
(array<>::swap): Likewise.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278718 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libstdc++-v3/ChangeLog | 3 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/array | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 986ac2a00c6..8e384c76506 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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. diff --git a/libstdc++-v3/include/debug/array b/libstdc++-v3/include/debug/array index 5566a087f9a..4e0fac8daac 100644 --- a/libstdc++-v3/include/debug/array +++ b/libstdc++-v3/include/debug/array @@ -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))) |