File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 4
4
#include " ../simple_test.hpp"
5
5
#include " ../test_utils.hpp"
6
6
7
+ template <class >
8
+ void test_forward (std::false_type)
9
+ {}
10
+
11
+ template <class R >
12
+ void test_forward (std::true_type)
13
+ {
14
+ CPP_assert (ranges::forward_range<R>);
15
+ }
16
+
7
17
int main ()
8
18
{
9
19
using namespace ranges ;
@@ -22,12 +32,14 @@ int main()
22
32
::has_type<const std::sub_match<std::string::iterator>&>(*ranges::begin (crng));
23
33
24
34
CPP_assert (common_range<decltype (rng)>);
25
- CPP_assert (forward_range<decltype (rng)>);
35
+ const bool is_bidi = bidirectional_iterator<std::regex_token_iterator<std::string::iterator>>;
36
+ test_forward<decltype (rng)>(std::integral_constant<bool , is_bidi>{});
26
37
CPP_assert (!bidirectional_range<decltype (rng)>);
27
38
CPP_assert (!sized_range<decltype (rng)>);
28
39
29
40
CPP_assert (common_range<decltype (crng)>);
30
- CPP_assert (forward_range<decltype (crng)>);
41
+ const bool const_is_bidi = bidirectional_iterator<std::regex_token_iterator<std::string::const_iterator>>;
42
+ test_forward<decltype (crng)>(std::integral_constant<bool , const_is_bidi>{});
31
43
CPP_assert (!bidirectional_range<decltype (crng)>);
32
44
CPP_assert (!sized_range<decltype (crng)>);
33
45
You can’t perform that action at this time.
0 commit comments