Reactions  0.1.0
Handling reaction trees and decays
utils.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <tuple>
3 
5 namespace reactions::utils {
6 
8  template <class T> struct dependent_false : std::false_type {};
9 
11  template <class T>
13 
15  namespace detail {
17  template <std::size_t I, class Tuple, class E0, class E1>
18  struct tuple_index {
19  static constexpr auto value =
20  tuple_index<I + 1, Tuple, E0,
21  std::tuple_element_t<I + 1, Tuple>>::value;
22  };
23 
25  template <std::size_t I, class Tuple, class E>
26  struct tuple_index<I, Tuple, E, E> {
27  static constexpr auto value = I;
28  };
29  } // namespace detail
30 
32  template <class E, class Tuple> struct tuple_index {
33  static constexpr auto value =
35  };
36 
38  template <class E, class Tuple>
40 
42  template <class Type, template <class...> class Template>
44 
46  template <template <class...> class Template, class... T>
47  struct is_template_specialization<Template<T...>, Template> : std::true_type {
48  };
49 
50  template <class Type, template <class...> class Template>
51  static constexpr auto is_template_specialization_v =
53 } // namespace reactions::utils
static constexpr auto dependent_false_v
A false type that can be used with static_assert
Definition: utils.hpp:12
General utilities.
Definition: utils.hpp:5
Check whether a type is a specialization of a template.
Definition: utils.hpp:43
Index corresponding to a given element.
Definition: utils.hpp:32
static constexpr auto is_template_specialization_v
Definition: utils.hpp:51
Index corresponding to a given element.
Definition: utils.hpp:18
static constexpr auto tuple_index_v
Index corresponding to a given element.
Definition: utils.hpp:39
A false type that can be used with static_assert
Definition: utils.hpp:8