VCCC  2024.05
VisualCamp Common C++ library
constant_range.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2023/12/30.
3 //
4 
5 #ifndef VCCC_RANGES_CONSTANT_RANGE_HPP
6 #define VCCC_RANGES_CONSTANT_RANGE_HPP
7 
8 #include <type_traits>
9 
16 #include "vccc/__ranges/view.hpp"
17 
18 namespace vccc {
19 namespace ranges {
20 namespace detail {
21 
22 template<
23  typename T,
24  bool = conjunction<
25  input_iterator<T>,
26  has_typename_type<iter_const_reference<T>>
27  >::value /* true */
28 >
29 struct constant_range_constant_iterator : same_as<iter_const_reference_t<T>, iter_reference_t<T>> {};
30 template<typename T>
31 struct constant_range_constant_iterator<T, false> : std::false_type {};
32 
34 struct constant_range_impl : constant_range_constant_iterator<iterator_t<T>> {};
35 template<typename T>
36 struct constant_range_impl<T, false> : std::false_type {};
37 
38 } // namespace detail
39 
42 
43 
52 template<typename T>
53 struct constant_range : detail::constant_range_impl<T> {};
54 
56 
57 } // namespace ranges
58 } // namespace vccc
59 
60 #endif // VCCC_RANGES_CONSTANT_RANGE_HPP
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
specifies the requirements for a range to be safely convertible to a view
Definition: constant_range.hpp:53