Skip to content

Commit 2dc5272

Browse files
authored
PWGMM: Mult: use concepts instead of functions (#5573)
1 parent 92e8b7a commit 2dc5272

File tree

2 files changed

+71
-77
lines changed

2 files changed

+71
-77
lines changed

PWGMM/Mult/Core/include/Functions.h

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,20 @@ namespace pwgmm::mult
1717
{
1818
using namespace o2;
1919

20-
// helper function to determine if collision/mccollison type contains centrality
20+
// clang-format off
2121
template <typename T>
22-
static constexpr bool hasSimCent()
22+
concept hasSimCent = (T*) //NOLINT
2323
{
24-
if constexpr (!soa::is_soa_join_v<T>) {
25-
return false;
26-
} else {
27-
return T::template contains<aod::HepMCHeavyIons>();
28-
}
29-
}
24+
requires {T::template contains<aod::HepMCHeavyIons>();}
25+
};
3026

3127
template <typename T>
32-
static constexpr bool hasRecoCent()
28+
concept hasRecoCent = (T*) //NOLINT
3329
{
34-
if constexpr (!soa::is_soa_join_v<T>) {
35-
return false;
36-
} else {
37-
return T::template contains<aod::CentFT0Cs>() || T::template contains<aod::CentFT0Ms>();
38-
}
39-
}
30+
requires {T::template contains<aod::CentFT0Cs>() || T::template contains<aod::CentFT0Ms>();}
31+
};
32+
33+
//clang-format on
4034
} // namespace pwgmm::mult
4135

4236
#endif // PWGMM_MULT_CORE_INCLUDE_FUNCTIONS_H_

0 commit comments

Comments
 (0)