22 #ifndef GEARS_CONCEPTS_ITERATOR_HPP
23 #define GEARS_CONCEPTS_ITERATOR_HPP
30 struct is_random_access {
32 typename D =
typename Bare<It>::difference_type,
33 typename R =
typename Bare<It>::reference,
34 TrueIf<std::is_same<decltype(std::declval<It&>() += 2), It&>,
35 std::is_same<decltype(std::declval<It&>() + 2), It>,
36 std::is_same<decltype(2 + std::declval<It&>()), It>,
37 std::is_same<decltype(std::declval<It&>() -= 2), It&>,
38 std::is_same<decltype(std::declval<It&>() - 2), It>,
39 std::is_same<decltype(std::declval<It&>() - (std::declval<It&>() + 2)), D>,
40 std::is_convertible<decltype(std::declval<It&>()[2]), R>>...>
41 static std::true_type test(
int);
43 static std::false_type test(...);
209 And<BidirectionalIterator<T>,
211 TraitOf<detail::is_random_access, T>>> {};
231 #endif // GEARS_CONCEPTS_ITERATOR_HPP