Skip to content

Commit 3d2a186

Browse files
committed
fixup! use requirements instead of if-constexpr
1 parent 0684d49 commit 3d2a186

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
@@ -1145,9 +1145,12 @@ struct TableIterator : IP, C... {
11451145
void doSetCurrentIndex(framework::pack<CL...>, TA* current)
11461146
{
11471147
(framework::overloaded{
1148-
[&current, this]<is_index_column CI> requires(!is_self_index_column<CI>) () { CI::setCurrent(current); },
1149-
[]<typename CI>(){}
1150-
}.template operator()<CL>(), ...);
1148+
[&current, this]<is_index_column CI>
1149+
requires(!is_self_index_column<CI>)
1150+
() { CI::setCurrent(current); },
1151+
[]<typename CI>() {}}
1152+
.template operator()<CL>(),
1153+
...);
11511154
}
11521155

11531156
template <typename CL>
@@ -1161,11 +1164,14 @@ struct TableIterator : IP, C... {
11611164
{
11621165
std::vector<o2::soa::Binding> result;
11631166
(framework::overloaded{
1164-
[this, &result]<is_index_column CI> requires(!is_self_index_column<CI>) () mutable {
1165-
result.emplace_back(CI::getCurrentRaw());
1166-
},
1167-
[]<typename CI>(){}
1168-
}.template operator()<Cs>(), ...);
1167+
[this, &result]<is_index_column CI>
1168+
requires(!is_self_index_column<CI>)
1169+
() mutable {
1170+
result.emplace_back(CI::getCurrentRaw());
1171+
},
1172+
[]<typename CI>() {}}
1173+
.template operator()<Cs>(),
1174+
...);
11691175
return result;
11701176
}
11711177

@@ -1184,9 +1190,12 @@ struct TableIterator : IP, C... {
11841190
void doSetCurrentIndexRaw(framework::pack<Cs...> p, std::vector<o2::soa::Binding>&& ptrs)
11851191
{
11861192
(framework::overloaded{
1187-
[&ptrs, p, this]<is_self_index_column CI> requires(!is_self_index_column<CI>) () { CI::setCurrentRaw(ptrs[framework::has_type_at_v<CI>(p)]); },
1188-
[]<typename CI>(){}
1189-
}.template operator()<Cs>(), ...);
1193+
[&ptrs, p, this]<is_self_index_column CI>
1194+
requires(!is_self_index_column<CI>)
1195+
() { CI::setCurrentRaw(ptrs[framework::has_type_at_v<CI>(p)]); },
1196+
[]<typename CI>() {}}
1197+
.template operator()<Cs>(),
1198+
...);
11901199
}
11911200

11921201
template <typename... Cs, typename I>
@@ -1195,9 +1204,10 @@ struct TableIterator : IP, C... {
11951204
o2::soa::Binding b;
11961205
b.bind(ptr);
11971206
(framework::overloaded{
1198-
[&ptr, &b, this]<is_self_index_column CI>() { CI::setCurrentRaw(b); },
1199-
[]<typename CI>(){}
1200-
}.template operator()<Cs>(), ...);
1207+
[&ptr, &b, this]<is_self_index_column CI>() { CI::setCurrentRaw(b); },
1208+
[]<typename CI>() {}}
1209+
.template operator()<Cs>(),
1210+
...);
12011211
}
12021212

12031213
void bindExternalIndicesRaw(std::vector<o2::soa::Binding>&& ptrs)
@@ -1393,18 +1403,24 @@ template <typename B, typename... C>
13931403
consteval static bool hasIndexTo(framework::pack<C...>&&)
13941404
{
13951405
return (framework::overloaded{
1396-
[]<is_index_column CI> requires(!is_self_index_column<CI>) () { return o2::soa::is_binding_compatible_v<B, typename CI::binding_t>(); },
1397-
[]<typename CI>(){ return false; }
1398-
}.template operator()<C>() || ...);
1406+
[]<is_index_column CI>
1407+
requires(!is_self_index_column<CI>)
1408+
() { return o2::soa::is_binding_compatible_v<B, typename CI::binding_t>(); },
1409+
[]<typename CI>() { return false; }}
1410+
.template operator()<C>() ||
1411+
...);
13991412
}
14001413

14011414
template <typename B, typename... C>
14021415
consteval static bool hasSortedIndexTo(framework::pack<C...>&&)
14031416
{
14041417
return (framework::overloaded{
1405-
[]<is_index_column CI> requires(!is_self_index_column<CI>) () {return (CI::sorted && o2::soa::is_binding_compatible_v<B, typename CI::binding_t>()); },
1406-
[]<typename CI>(){}
1407-
}.template operator()<C>() || ...);
1418+
[]<is_index_column CI>
1419+
requires(!is_self_index_column<CI>)
1420+
() { return (CI::sorted && o2::soa::is_binding_compatible_v<B, typename CI::binding_t>()); },
1421+
[]<typename CI>() {}}
1422+
.template operator()<C>() ||
1423+
...);
14081424
}
14091425

14101426
template <typename B, typename Z>
@@ -2075,9 +2091,10 @@ class Table
20752091
void doBindInternalIndicesExplicit(framework::pack<Cs...>, o2::soa::Binding binding)
20762092
{
20772093
(framework::overloaded{
2078-
[this, &binding]<is_self_index_column CI>() { static_cast<CI>(mBegin).setCurrentRaw(binding); },
2079-
[]<typename CI>(){}
2080-
}.template operator()<Cs>(), ...);
2094+
[this, &binding]<is_self_index_column CI>() { static_cast<CI>(mBegin).setCurrentRaw(binding); },
2095+
[]<typename CI>() {}}
2096+
.template operator()<Cs>(),
2097+
...);
20812098
}
20822099

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

0 commit comments

Comments
 (0)