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