CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
StackProcess.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 
20  template <class TProcess, typename TReturn, typename... TArgs>
21  struct has_method_doStack : public detail::has_method_signature<TReturn, TArgs...> {
22 
24  using detail::has_method_signature<TReturn, TArgs...>::testSignature;
25 
27  template <class T>
28  static std::false_type test(...);
29 
31  template <class T>
32  static decltype(testSignature(&T::template doStack<TArgs...>)) test(std::nullptr_t);
33 
35  template <template <typename> typename T>
36  static decltype(testSignature(&T<TArgs...>::template doStack)) test(std::nullptr_t);
37 
39  template <class T>
40  static decltype(testSignature(&T::doStack)) test(std::nullptr_t);
41 
42  public:
47  using type = decltype(test<std::decay_t<TProcess>>(nullptr));
48  static const bool value = type::value;
50  };
51 
54  template <class TProcess, typename TReturn, typename... TArgs>
55  bool constexpr has_method_doStack_v =
56  has_method_doStack<TProcess, TReturn, TArgs...>::value;
57 
58 } // namespace corsika
traits test for StackProcess::doStack method
static decltype(testSignature(&T< TArgs... >::template doStack)) test(std::nullptr_t)
templated-template parameter option
static decltype(testSignature(&T::doStack)) 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 doStack< TArgs... >)) test(std::nullptr_t)
templated parameter option