VCCC  2024.05
VisualCamp Common C++ library
random_access_range.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2023/12/26.
3 //
4 
5 #ifndef VCCC_RANGES_RANDOM_ACCESS_RANGE_HPP_
6 #define VCCC_RANGES_RANDOM_ACCESS_RANGE_HPP_
7 
8 #include <type_traits>
9 
15 
16 namespace vccc {
17 namespace ranges {
18 namespace detail {
19 
20 template<
21  typename T,
22  bool =
23  conjunction<
24  bidirectional_range<T>,
25  has_typename_type<iterator<T>>
26  >::value
27 >
28 struct random_access_range_impl : std::false_type {};
29 
30 template<typename T>
31 struct random_access_range_impl<T, true> : random_access_iterator<iterator_t<T>> {};
32 
33 } // namespace ranges
34 
37 
47 template<typename T>
48 struct random_access_range : detail::random_access_range_impl<T> {};
49 
50 
52 
53 } // namespace vccc
54 } // namespace ranges
55 
56 #endif // VCCC_RANGES_RANDOM_ACCESS_RANGE_HPP_
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
specifies a range whose iterator type satisfies random_access_iterator
Definition: random_access_range.hpp:48