Project
Loading...
Searching...
No Matches
Traits.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11#ifndef O2_FRAMEWORK_TRAITS_H_
12#define O2_FRAMEWORK_TRAITS_H_
13
14#include <type_traits>
15#include <concepts>
16
17namespace o2::framework
18{
22
23template <typename T, template <typename...> class Ref>
24struct is_specialization : std::false_type {
25};
26
27template <template <typename...> class Ref, typename... Args>
28struct is_specialization<Ref<Args...>, Ref> : std::true_type {
29};
30
31template <typename T, template <typename...> class Ref>
33
34template <template <typename...> typename T, typename S>
35concept specialization_of_template = requires {
36 {
37 []<typename... Ts>(T<Ts...>*) -> T<Ts...> {}(std::declval<std::decay_t<S>*>())
38 } -> std::same_as<std::decay_t<S>>;
39};
40
41template <typename A, typename B>
42struct is_overriding : public std::bool_constant<std::is_same_v<A, B> == false && std::is_member_function_pointer_v<A> && std::is_member_function_pointer_v<B>> {
43};
44
45template <typename... T>
46struct always_static_assert : std::false_type {
47};
48
49template <typename... T>
51
52template <template <typename...> typename B, typename D>
53concept base_of_template = requires {
54 []<typename... Ts>(B<Ts...>*) {}(std::declval<std::decay_t<D>*>());
55};
56
57template <template <typename...> typename B, typename D>
59
60} // namespace o2::framework
61
62#endif // O2_FRAMEWORK_TRAITS_H_
Definition B.h:16
GLsizei const GLfloat * value
Definition glcorearb.h:819
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
constexpr bool is_base_of_template_v
Definition Traits.h:58
constexpr bool always_static_assert_v
Definition Traits.h:50
constexpr bool is_specialization_v
Definition Traits.h:32