Skip to content

Commit 152d4e3

Browse files
committed
libstdc++: Only define __any_input_iterator for C++20
Currently this new concept will get defined for -std=c++17 -fconcepts but as it uses std::input_iterator, which is new in C++20, that won't work. Guard it with __cpp_lib_concepts as well as __cpp_concepts. libstdc++-v3/ChangeLog: * include/bits/stl_iterator_base_types.h (__any_input_iterator): Only define when __cpp_lib_concepts is defined.
1 parent 22d8b89 commit 152d4e3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libstdc++-v3/include/bits/stl_iterator_base_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
258258
concept __has_input_iter_cat
259259
= is_convertible_v<__iter_category_t<_InIter>, input_iterator_tag>;
260260

261+
#ifdef __cpp_lib_concepts
261262
// Is a Cpp17InputIterator or satisfies std::input_iterator.
262263
template<typename _InIterator>
263264
concept __any_input_iterator
264265
= input_iterator<_InIterator> || __has_input_iter_cat<_InIterator>;
266+
#endif
265267
#endif
266268

267269
template<typename _It,

0 commit comments

Comments
 (0)