match.pd: Fix indefinite recursion during exp-log transformations [PR118490]
[gcc.git] / libstdc++-v3 / testsuite / 25_algorithms / pstl / 110512.cc
blob188c7c915e5143a0f22df214596605d18fdfb3bc
1 // { dg-do compile { target c++17 } }
3 // Bug 110512 - C++20 random access iterators run sequentially with PSTL
5 #include <algorithm>
6 #include <execution>
7 #include <ranges>
8 #include <testsuite_iterators.h>
10 using InputIter = __gnu_test::input_iterator_wrapper<int>;
11 using FwdIter = __gnu_test::forward_iterator_wrapper<long>;
12 using RAIter = __gnu_test::random_access_iterator_wrapper<float>;
14 template<typename... Iter>
15 constexpr bool all_random_access
16 = __pstl::__internal::__are_random_access_iterators<Iter...>::value;
18 using __pstl::__internal::__are_random_access_iterators;
19 static_assert( all_random_access<RAIter> );
20 static_assert( all_random_access<int*, RAIter, const long*> );
21 static_assert( ! all_random_access<RAIter, FwdIter> );
22 static_assert( ! all_random_access<FwdIter, InputIter, RAIter> );
24 #if __cpp_lib_ranges
25 using IotaIter = std::ranges::iterator_t<std::ranges::iota_view<int, int>>;
26 static_assert( std::random_access_iterator<IotaIter> );
27 static_assert( all_random_access<IotaIter> );
28 static_assert( all_random_access<IotaIter, RAIter> );
29 static_assert( all_random_access<RAIter, IotaIter> );
30 static_assert( ! all_random_access<RAIter, IotaIter, FwdIter> );
31 #endif