Wildmeshing Toolkit
remove_void_types.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <tuple>
3 #include "concatenate_types.hpp"
4 
5 
7 namespace detail {
8 template <typename...>
9 struct remove_void
10 {
11  using type = std::tuple<>;
12 };
13 template <>
15 {
16  using type = std::tuple<>;
17 };
18 template <typename T>
20 {
21  using type = std::tuple<T>;
22 };
23 
24 template <typename... Ts>
25 using remove_void_t = typename remove_void<Ts...>::type;
26 
27 template <typename T, typename RemainingTuple>
29 {
30 };
31 template <typename T, typename... Ts>
32 struct remove_void_tuple<T, std::tuple<Ts...>>
33 {
34  constexpr static bool t_not_void = !std::is_same_v<T, void>;
35  using adding_t_type = std::conditional_t<t_not_void, std::tuple<T>, std::tuple<>>;
36 
38 };
39 
40 template <typename T, typename... Ts>
41 struct remove_void<T, Ts...>
42 {
43  using type = typename remove_void_tuple<T, std::tuple<Ts...>>::type;
44 };
45 } // namespace detail
46 
47 template <typename... Ts>
49 } // namespace wmtk::utils::metaprogramming::tuple
Definition: autodiff.h:995
typename remove_void< Ts... >::type remove_void_t
typename concatenate_types< T, U >::type concatenate_types_t
detail::remove_void_t< Ts... > remove_void_types_t
typename remove_void_tuple< T, std::tuple< Ts... > >::type type
std::conditional_t< t_not_void, std::tuple< T >, std::tuple<> > adding_t_type