VCCC  2024.05
VisualCamp Common C++ library
iter_common_reference_t.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2023/12/28.
3 //
4 
5 #ifndef VCCC_ITERATOR_ITER_COMMON_REFERENCE_T_HPP
6 #define VCCC_ITERATOR_ITER_COMMON_REFERENCE_T_HPP
7 
13 
14 namespace vccc {
15 namespace detail {
16 
17 template<
18  typename T,
19  bool = has_typename_type<
20  common_reference< iter_reference_t<T>,
21  iter_value_t<T>& >
22  >::value /* true */
23 >
24 struct iter_common_reference_impl_2 {
25  using type = common_reference_t<iter_reference_t<T>, iter_value_t<T>&>;
26 };
27 template<typename T>
28 struct iter_common_reference_impl_2<T, false> {};
29 
31 struct iter_common_reference_impl_1 : iter_common_reference_impl_2<T> {};
32 template<typename T>
33 struct iter_common_reference_impl_1<T, false> {};
34 
35 } // namespace detail
36 
39 
40 template<typename T>
41 struct iter_common_reference : detail::iter_common_reference_impl_1<T> {};
42 
45 template<typename T>
46 using iter_common_reference_t = typename iter_common_reference<T>::type;
47 
49 
50 } // namespace vccc
51 
52 #endif // VCCC_ITERATOR_ITER_COMMON_REFERENCE_T_HPP
typename iter_common_reference< T >::type iter_common_reference_t
Computes the common reference type of T. This is the common reference type between its reference type...
Definition: iter_common_reference_t.hpp:46
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: iter_common_reference_t.hpp:41