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
17
namespace
o2::framework
18
{
22
23
template
<
typename
T
,
template
<
typename
...>
class
Ref>
24
struct
is_specialization
: std::false_type {
25
};
26
27
template
<
template
<
typename
...>
class
Ref,
typename
... Args>
28
struct
is_specialization
<Ref<Args...>, Ref> : std::true_type {
29
};
30
31
template
<
typename
T,
template
<
typename
...>
class
Ref>
32
inline
constexpr
bool
is_specialization_v
=
is_specialization<T, Ref>::value
;
33
34
template
<
template
<
typename
...>
typename
T,
typename
S
>
35
concept
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
41
template
<
typename
A,
typename
B>
42
struct
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
45
template
<
typename
... T>
46
struct
always_static_assert
: std::false_type {
47
};
48
49
template
<
typename
... T>
50
inline
constexpr
bool
always_static_assert_v
=
always_static_assert
<T...>
::value
;
51
52
template
<
template
<
typename
...>
typename
B
,
typename
D>
53
concept
base_of_template
=
requires
{
54
[]<
typename
... Ts>(
B
<Ts...>*) {}(std::declval<std::decay_t<D>*>());
55
};
56
57
template
<
template
<
typename
...>
typename
B
,
typename
D>
58
constexpr
bool
is_base_of_template_v
=
base_of_template<B, D>
;
59
60
}
// namespace o2::framework
61
62
#endif
// O2_FRAMEWORK_TRAITS_H_
B
Definition
B.h:16
o2::framework::base_of_template
Definition
Traits.h:53
o2::framework::specialization_of_template
Definition
Traits.h:35
value
GLsizei const GLfloat * value
Definition
glcorearb.h:819
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::is_base_of_template_v
constexpr bool is_base_of_template_v
Definition
Traits.h:58
o2::framework::always_static_assert_v
constexpr bool always_static_assert_v
Definition
Traits.h:50
o2::framework::is_specialization_v
constexpr bool is_specialization_v
Definition
Traits.h:32
o2::math_utils::detail::T
T
Definition
SMatrixGPU.h:747
S
Definition
cxx14-test-aggregate-initialization.cxx:18
o2::framework::always_static_assert
Definition
Traits.h:46
o2::framework::is_overriding
Definition
Traits.h:42
o2::framework::is_specialization
Definition
Traits.h:24
Framework
Foundation
include
Framework
Traits.h
Generated on Tue Feb 25 2025 17:03:22 for Project by
1.9.8