This implements LWG4125, "move_iterator's default constructor should
be constrained". As for other operations on move_iterator, the constrain
is only when concepts are available (__glibcxx_concepts).
libstdc++-v3/ChangeLog:
* include/bits/stl_iterator.h (move_iterator::move_iterator())
[__glibcxx_concepts]: Constrain with default_initializable.
* testsuite/24_iterators/move_iterator/default_init.cc: New test.
---
Testing on x86_64-linux. *iterator* test already passed. OK for trunk
when all test passes?
libstdc++-v3/include/bits/stl_iterator.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libstdc++-v3/include/bits/stl_iterator.h
b/libstdc++-v3/include/bits/stl_iterator.h
index bcc22c50de5..c8418266e0c 100644
--- a/libstdc++-v3/include/bits/stl_iterator.h
+++ b/libstdc++-v3/include/bits/stl_iterator.h
@@ -1508,8 +1508,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__base_ref>;
#endif
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 4125. move_iterator's default constructor should be constrained
_GLIBCXX17_CONSTEXPR
move_iterator()
+#ifdef __glibcxx_concepts
+ requires default_initializable<_Iterator>
+#endif
: _M_current() { }
explicit _GLIBCXX17_CONSTEXPR
--
2.55.0