CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
ImplementsMixin.hpp
Go to the documentation of this file.
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 #pragma once
9 
14 #include <type_traits>
15 
16 namespace corsika {
17 
18  namespace detail {
19 
27  template <template <typename> typename Mixin, typename T>
29 
30  template <typename U>
31  static std::true_type test(Mixin<U>&);
32  static std::false_type test(...);
33 
34  public:
35  using type = decltype(test(std::declval<T&>()));
36  static constexpr bool value = type::value;
37  };
38 
39  template <template <typename> typename Mixin, typename T>
40  bool constexpr implements_mixin_v = implements_mixin<Mixin, T>::value;
41 
42  } // namespace detail
43 } // namespace corsika
`, since they are used everywhere as integral part of the framework.
Helper traits class (partial) for static compile time checking.