VCCC  2024.05
VisualCamp Common C++ library
range.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2023/12/24.
3 //
4 
5 #ifndef VCCC_RANGES_RANGE_HPP_
6 #define VCCC_RANGES_RANGE_HPP_
7 
8 #include <type_traits>
9 
10 #include "vccc/__ranges/begin.hpp"
11 #include "vccc/__ranges/end.hpp"
14 
15 namespace vccc {
16 namespace ranges {
17 namespace detail {
18 
19 template<typename T, bool = is_referencable<T>::value, typename = void, typename = void>
20 struct is_range : std::false_type {};
21 
22 template<typename T>
23 struct is_range<T, true,
24  void_t<decltype(ranges::begin(std::declval<T&>()))>,
25  void_t<decltype(ranges::end(std::declval<T&>()))>
26  > : std::true_type {};
27 
28 } // namespace detail
29 
32 
33 
52 template<typename T>
53 struct range : detail::is_range<T> {};
54 
56 
57 } // namespace ranges
58 } // namespace vccc
59 
60 #endif // VCCC_RANGES_RANGE_HPP_
constexpr VCCC_INLINE_OR_STATIC detail::begin_niebloid begin
returns an iterator to the beginning of a range
Definition: begin.hpp:116
void void_t
Definition: void_t.hpp:19
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
specifies that a type is a range, that is, it provides a begin iterator and an end sentinel
Definition: range.hpp:53