VCCC  2024.05
VisualCamp Common C++ library
iter_const_reference_t.hpp
Go to the documentation of this file.
1 //
2 // Created by cosge on 2023-12-31.
3 //
4 
5 #ifndef VCCC_ITERATOR_ITER_CONST_REFERENCE_T_HPP
6 #define VCCC_ITERATOR_ITER_CONST_REFERENCE_T_HPP
7 
13 
14 namespace vccc {
15 namespace detail {
16 
17 template<
18  typename T,
19  bool v = has_typename_type<
20  common_reference<
21  const iter_value_t<T>&&,
22  iter_reference_t<T>
23  >
24  >::value /* true */
25 >
26 struct iter_const_reference_impl_2 {
27  using type = common_reference_t<const iter_value_t<T>&&, iter_reference_t<T>>;
28 };
29 template<typename T>
30 struct iter_const_reference_impl_2<T, false> {};
31 
32 
34 struct iter_const_reference_impl_1 : iter_const_reference_impl_2<T> {};
35 template<typename T>
36 struct iter_const_reference_impl_1<T, false> {};
37 
38 } // namespace detail
39 
42 
43 template<typename T>
44 struct iter_const_reference : detail::iter_const_reference_impl_1<T> {};
45 
46 template<typename T>
47 using iter_const_reference_t = typename iter_const_reference<T>::type;
48 
50 
51 } // namespace vccc
52 
53 #endif // VCCC_ITERATOR_ITER_CONST_REFERENCE_T_HPP
typename iter_const_reference< T >::type iter_const_reference_t
Definition: iter_const_reference_t.hpp:47
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: iter_const_reference_t.hpp:44