capydi
Loading...
Searching...
No Matches
FilterMap.hpp
Go to the documentation of this file.
1#ifndef FILTER_FILTER_MAP_HPP_
2#define FILTER_FILTER_MAP_HPP_
3
6#include "Prepend.hpp"
7
8namespace capy::meta::legacy
9{
10
11template<
12 typename Pack,
13 template<typename> typename Mapper
14>
15struct FilterMap;
16
17template<
18 template<typename> typename Mapper,
19 typename Head,
20 typename... Tail
21>
22struct FilterMap<Pack<Head, Tail...>, Mapper>
23{
24private:
25 using /* T */ MappedType = typename Mapper<Head>::type;
26 using /* Pack<?> */ RecursionTail = typename FilterMap<Pack<Tail...>, Mapper>::type;
27
28public:
29 using /* Pack<?> */ type = std::conditional_t<
30 std::same_as<MappedType, None>,
31 RecursionTail,
33 >;
34};
35
36template<
37 template<typename> typename Mapper
38>
39struct FilterMap<Pack<>, Mapper>
40{
41 using type = Pack<>;
42};
43
44template<
45 typename Pack,
46 template<typename> typename Mapper
47>
49
50}
51
52#endif // !FILTER_FILTER_MAP_HPP_
Compile-time type pack utilities and metaprogramming foundations.
Definition Append.hpp:7
typename FilterMap< Pack, Mapper >::type filter_map_t
Definition FilterMap.hpp:48
typename Prepend< Element, Pack >::type prepend_t
Definition Prepend.hpp:19
A compile-time heterogeneous type list.
Definition Pack.hpp:70
std::conditional_t< std::same_as< MappedType, None >, RecursionTail, prepend_t< MappedType, RecursionTail > > type
Definition FilterMap.hpp:29
Pack<> type
Definition FilterMap.hpp:41
Definition FilterMap.hpp:15
Definition Head.hpp:11