mirror of
https://github.com/gcc-mirror/gcc.git
synced 2025-07-21 23:52:54 +00:00
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.
This commit is contained in:

committed by
Jonathan Wakely

parent
22d8b89689
commit
152d4e3cf1
@ -258,10 +258,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
concept __has_input_iter_cat
|
||||
= is_convertible_v<__iter_category_t<_InIter>, input_iterator_tag>;
|
||||
|
||||
#ifdef __cpp_lib_concepts
|
||||
// Is a Cpp17InputIterator or satisfies std::input_iterator.
|
||||
template<typename _InIterator>
|
||||
concept __any_input_iterator
|
||||
= input_iterator<_InIterator> || __has_input_iter_cat<_InIterator>;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
template<typename _It,
|
||||
|
Reference in New Issue
Block a user