VCCC  2024.05
VisualCamp Common C++ library
iter_mapped_t.hpp
Go to the documentation of this file.
1 //
2 // Created by cosge on 2024-01-13.
3 //
4 
5 #ifndef VCCC_ITERATOR_ITER_MAPPED_T_HPP_
6 #define VCCC_ITERATOR_ITER_MAPPED_T_HPP_
7 
8 #include <tuple>
9 #include <type_traits>
10 
14 
15 namespace vccc {
16 namespace detail {
17 
18 template<typename V, bool = is_complete<std::tuple_element<1, V>>::value /* true */>
19 struct iter_mapped_impl_2 {
20  using type = std::tuple_element_t<1, V>;
21 };
22 template<typename V>
23 struct iter_mapped_impl_2<V, false> {};
24 
25 template<typename I, bool = has_typename_type< iter_val<I> >::value /* true */>
26 struct iter_mapped_impl : iter_mapped_impl_2<iter_val_t<I>> {};
27 template<typename I>
28 struct iter_mapped_impl<I, false> {};
29 
30 } // namespace detail
31 
34 
35 template<typename T>
36 struct iter_mapped : detail::iter_mapped_impl<T> {};
37 
39 template<typename T>
40 using iter_mapped_t = typename iter_mapped<T>::type;
41 
43 
44 } // namespace vccc
45 
46 #endif // VCCC_ITERATOR_ITER_MAPPED_T_HPP_
typename iter_mapped< T >::type iter_mapped_t
Definition: iter_mapped_t.hpp:40
Definition: directory.h:12
Definition: iter_mapped_t.hpp:36