CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
BoundaryCrossingProcess.hpp
1 /*
2  * (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu
3  *
4  * This software is distributed under the terms of the GNU General Public
5  * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
6  * the license.
7  */
8 
9 #pragma once
10 
13 
14 namespace corsika {
15 
19  template <class TProcess, typename TReturn, typename TParticle>
21  : public detail::has_method_signature<TReturn, TParticle&,
22  typename TParticle::node_type const&,
23  typename TParticle::node_type const&> {
24 
27  TReturn, TParticle&, typename TParticle::node_type const&,
28  typename TParticle::node_type const&>::testSignature;
29 
31  template <class T>
32  static std::false_type test(...);
33 
35  template <class T>
36  static decltype(testSignature(&T::template doBoundaryCrossing<TParticle>)) test(
37  std::nullptr_t);
38 
40  template <class T>
41  static decltype(testSignature(&T::doBoundaryCrossing)) test(std::nullptr_t);
42 
43  public:
48  using type = decltype(test<std::decay_t<TProcess>>(nullptr));
49  static const bool value = type::value;
51  };
52 
55 
56  template <class TProcess, typename TReturn, typename TParticle>
57  bool constexpr has_method_doBoundaryCrossing_v =
59 
60 } // namespace corsika
traits test for BoundaryCrossingProcess::doBoundaryCrossing method
`, since they are used everywhere as integral part of the framework.
static decltype(testSignature(&T::template doBoundaryCrossing< TParticle >)) test(std::nullptr_t)
templated parameter option
static decltype(testSignature(&T::doBoundaryCrossing)) test(std::nullptr_t)
non templated parameter option
Helper traits class (partial) for static compile time checking.