CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
SecondariesProcess.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... TArg>
21  : public detail::has_method_signature<TReturn, TArg...> {
22 
24  using detail::has_method_signature<TReturn, TArg...>::testSignature;
25 
27  template <class T>
28  static std::false_type test(...);
29 
31  template <class T>
32  static decltype(testSignature(&T::template doSecondaries<TArg...>)) test(
33  std::nullptr_t);
34 
36  template <class T>
37  static decltype(testSignature(&T::doSecondaries)) test(std::nullptr_t);
38 
39  public:
44  using type = decltype(test<std::decay_t<TProcess>>(nullptr));
45  static const bool value = type::value;
47  };
48 
54  template <class TProcess, typename TReturn, typename... TArg>
55  bool constexpr has_method_doSecondaries_v =
56  has_method_doSecondaries<TProcess, TReturn, TArg...>::value;
57 
58 } // namespace corsika
traits test for SecondariesProcess::doSecondaries method.
static decltype(testSignature(&T::doSecondaries)) test(std::nullptr_t)
non templated parameter option
`, since they are used everywhere as integral part of the framework.
Helper traits class (partial) for static compile time checking.
static decltype(testSignature(&T::template doSecondaries< TArg... >)) test(std::nullptr_t)
templated parameter option