|
1 | 1 | /*
|
2 |
| - Copyright (c) 2005-2021 Intel Corporation |
| 2 | + Copyright (c) 2005-2025 Intel Corporation |
3 | 3 |
|
4 | 4 | Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | you may not use this file except in compliance with the License.
|
@@ -102,20 +102,23 @@ concept tbb_range = std::copy_constructible<Range> &&
|
102 | 102 | { range.is_divisible() } -> relaxed_convertible_to<bool>;
|
103 | 103 | };
|
104 | 104 |
|
| 105 | +template <typename Iterator, typename IteratorTag> |
| 106 | +struct iterator_concept_helper; |
| 107 | + |
| 108 | +// New specializations should be added in case of using container_based_sequence with |
| 109 | +// the new iterator tag types |
105 | 110 | template <typename Iterator>
|
106 |
| -constexpr bool iterator_concept_helper( std::input_iterator_tag ) { |
107 |
| - return std::input_iterator<Iterator>; |
108 |
| -} |
| 111 | +struct iterator_concept_helper<Iterator, std::input_iterator_tag> { |
| 112 | + static constexpr bool value = std::input_iterator<Iterator>; |
| 113 | +}; |
109 | 114 |
|
110 | 115 | template <typename Iterator>
|
111 |
| -constexpr bool iterator_concept_helper( std::random_access_iterator_tag ) { |
112 |
| - return std::random_access_iterator<Iterator>; |
113 |
| -} |
| 116 | +struct iterator_concept_helper<Iterator, std::random_access_iterator_tag> { |
| 117 | + static constexpr bool value = std::random_access_iterator<Iterator>; |
| 118 | +}; |
114 | 119 |
|
115 | 120 | template <typename Iterator, typename IteratorTag>
|
116 |
| -concept iterator_satisfies = requires (IteratorTag tag) { |
117 |
| - requires iterator_concept_helper<Iterator>(tag); |
118 |
| -}; |
| 121 | +concept iterator_satisfies = iterator_concept_helper<Iterator, IteratorTag>::value; |
119 | 122 |
|
120 | 123 | template <typename Sequence, typename IteratorTag>
|
121 | 124 | concept container_based_sequence = requires( Sequence& seq ) {
|
|
0 commit comments