Nui
tuple_filter.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <type_traits>
6 #include <tuple>
7 
8 namespace Nui::Detail
9 {
10  template <template <typename> typename Predicate, typename... T>
11  struct TupleFilter
12  {
13  using type = std::tuple<>;
14  };
15 
16  template <template <typename> typename Predicate, typename Head, typename... Tail>
17  struct TupleFilter<Predicate, Head, Tail...>
18  {
19  private:
20  using previous = typename TupleFilter<Predicate, Tail...>::type;
21 
22  public:
23  using type = std::conditional_t<Predicate<Head>::value, TuplePushFront_t<previous, Head>, previous>;
24  };
25 
26  template <template <typename> typename Predicate, typename... T>
27  using TupleFilter_t = typename TupleFilter<Predicate, T...>::type;
28 }
Definition: rpc_hub.hpp:23
typename TupleFilter< Predicate, T... >::type TupleFilter_t
Definition: tuple_filter.hpp:27
typename TuplePushFront< Tuple, Elem >::type TuplePushFront_t
Definition: tuple_push_front.hpp:18
std::conditional_t< Predicate< Head >::value, TuplePushFront_t< previous, Head >, previous > type
Definition: tuple_filter.hpp:23
Definition: tuple_filter.hpp:12
std::tuple<> type
Definition: tuple_filter.hpp:13