Skip to content

Commit 8234bde

Browse files
committed
fixup! use requirements instead of if-constexpr
1 parent c67d408 commit 8234bde

File tree

1 file changed

+40
-23
lines changed
  • Framework/Core/include/Framework

1 file changed

+40
-23
lines changed

Framework/Core/include/Framework/ASoA.h

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,9 +1148,12 @@ struct TableIterator : IP, C... {
11481148
void doSetCurrentIndex(framework::pack<CL...>, TA* current)
11491149
{
11501150
(framework::overloaded{
1151-
[&current, this]<is_index_column CI> requires(!is_self_index_column<CI>) () { CI::setCurrent(current); },
1152-
[]<typename CI>(){}
1153-
}.template operator()<CL>(), ...);
1151+
[&current, this]<is_index_column CI>
1152+
requires(!is_self_index_column<CI>)
1153+
() { CI::setCurrent(current); },
1154+
[]<typename CI>() {}}
1155+
.template operator()<CL>(),
1156+
...);
11541157
}
11551158

11561159
template <typename CL>
@@ -1164,11 +1167,14 @@ struct TableIterator : IP, C... {
11641167
{
11651168
std::vector<o2::soa::Binding> result;
11661169
(framework::overloaded{
1167-
[this, &result]<is_index_column CI> requires(!is_self_index_column<CI>) () mutable {
1168-
result.emplace_back(CI::getCurrentRaw());
1169-
},
1170-
[]<typename CI>(){}
1171-
}.template operator()<Cs>(), ...);
1170+
[this, &result]<is_index_column CI>
1171+
requires(!is_self_index_column<CI>)
1172+
() mutable {
1173+
result.emplace_back(CI::getCurrentRaw());
1174+
},
1175+
[]<typename CI>() {}}
1176+
.template operator()<Cs>(),
1177+
...);
11721178
return result;
11731179
}
11741180

@@ -1187,9 +1193,12 @@ struct TableIterator : IP, C... {
11871193
void doSetCurrentIndexRaw(framework::pack<Cs...> p, std::vector<o2::soa::Binding>&& ptrs)
11881194
{
11891195
(framework::overloaded{
1190-
[&ptrs, p, this]<is_self_index_column CI> requires(!is_self_index_column<CI>) () { CI::setCurrentRaw(ptrs[framework::has_type_at_v<CI>(p)]); },
1191-
[]<typename CI>(){}
1192-
}.template operator()<Cs>(), ...);
1196+
[&ptrs, p, this]<is_self_index_column CI>
1197+
requires(!is_self_index_column<CI>)
1198+
() { CI::setCurrentRaw(ptrs[framework::has_type_at_v<CI>(p)]); },
1199+
[]<typename CI>() {}}
1200+
.template operator()<Cs>(),
1201+
...);
11931202
}
11941203

11951204
template <typename... Cs, typename I>
@@ -1198,9 +1207,10 @@ struct TableIterator : IP, C... {
11981207
o2::soa::Binding b;
11991208
b.bind(ptr);
12001209
(framework::overloaded{
1201-
[&ptr, &b, this]<is_self_index_column CI>() { CI::setCurrentRaw(b); },
1202-
[]<typename CI>(){}
1203-
}.template operator()<Cs>(), ...);
1210+
[&ptr, &b, this]<is_self_index_column CI>() { CI::setCurrentRaw(b); },
1211+
[]<typename CI>() {}}
1212+
.template operator()<Cs>(),
1213+
...);
12041214
}
12051215

12061216
void bindExternalIndicesRaw(std::vector<o2::soa::Binding>&& ptrs)
@@ -1396,18 +1406,24 @@ template <typename B, typename... C>
13961406
consteval static bool hasIndexTo(framework::pack<C...>&&)
13971407
{
13981408
return (framework::overloaded{
1399-
[]<is_index_column CI> requires(!is_self_index_column<CI>) () { return o2::soa::is_binding_compatible_v<B, typename CI::binding_t>(); },
1400-
[]<typename CI>(){ return false; }
1401-
}.template operator()<C>() || ...);
1409+
[]<is_index_column CI>
1410+
requires(!is_self_index_column<CI>)
1411+
() { return o2::soa::is_binding_compatible_v<B, typename CI::binding_t>(); },
1412+
[]<typename CI>() { return false; }}
1413+
.template operator()<C>() ||
1414+
...);
14021415
}
14031416

14041417
template <typename B, typename... C>
14051418
consteval static bool hasSortedIndexTo(framework::pack<C...>&&)
14061419
{
14071420
return (framework::overloaded{
1408-
[]<is_index_column CI> requires(!is_self_index_column<CI>) () {return (CI::sorted && o2::soa::is_binding_compatible_v<B, typename CI::binding_t>()); },
1409-
[]<typename CI>(){}
1410-
}.template operator()<C>() || ...);
1421+
[]<is_index_column CI>
1422+
requires(!is_self_index_column<CI>)
1423+
() { return (CI::sorted && o2::soa::is_binding_compatible_v<B, typename CI::binding_t>()); },
1424+
[]<typename CI>() {}}
1425+
.template operator()<C>() ||
1426+
...);
14111427
}
14121428

14131429
template <typename B, typename Z>
@@ -2078,9 +2094,10 @@ class Table
20782094
void doBindInternalIndicesExplicit(framework::pack<Cs...>, o2::soa::Binding binding)
20792095
{
20802096
(framework::overloaded{
2081-
[this, &binding]<is_self_index_column CI>() { static_cast<CI>(mBegin).setCurrentRaw(binding); },
2082-
[]<typename CI>(){}
2083-
}.template operator()<Cs>(), ...);
2097+
[this, &binding]<is_self_index_column CI>() { static_cast<CI>(mBegin).setCurrentRaw(binding); },
2098+
[]<typename CI>() {}}
2099+
.template operator()<Cs>(),
2100+
...);
20842101
}
20852102

20862103
void bindExternalIndicesRaw(std::vector<o2::soa::Binding>&& ptrs)

0 commit comments

Comments
 (0)