Skip to content

Commit 15dc389

Browse files
committed
improve use of requires
1 parent 778ad16 commit 15dc389

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

Framework/Core/include/Framework/AnalysisHelpers.h

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,40 +1054,36 @@ struct PartitionNG {
10541054
namespace o2::soa
10551055
{
10561056
/// On-the-fly adding of expression columns
1057-
template <typename T, typename... Cs>
1058-
requires(soa::is_soa_table_like_v<T>)
1057+
template <soa::soaTable T, typename... Cs>
1058+
requires (soa::is_type_spawnable_v<Cs> && ...)
10591059
auto Extend(T const& table)
10601060
{
1061-
static_assert((soa::is_type_spawnable_v<Cs> && ...), "You can only extend a table with expression columns");
10621061
using output_t = Join<T, soa::Table<OriginEnc{"JOIN"}, Cs...>>;
10631062
return output_t{{o2::framework::spawner<OriginEnc{"JOIN"}>(framework::pack<Cs...>{}, {table.asArrowTable()}, "dynamicExtension"), table.asArrowTable()}, 0};
10641063
}
10651064

1066-
template <typename T, typename... Cs>
1067-
requires(framework::is_base_of_template_v<TableNG, T>)
1065+
template <soa::ngTable T, typename... Cs>
1066+
requires (soa::is_type_spawnable_v<Cs> && ...)
10681067
auto Extend(T const& table)
10691068
{
1070-
static_assert((soa::is_type_spawnable_v<Cs> && ...), "You can only extend a table with expression columns");
10711069
using output_t = JoinNG<T, soa::TableNG<o2::aod::Hash<"JOIN"_h>, o2::aod::Hash<"JOIN/0"_h>, o2::aod::Hash<"JOIN"_h>, Cs...>>;
10721070
return output_t{{o2::framework::spawner(framework::pack<Cs...>{}, {table.asArrowTable()}, "dynamicExtension"), table.asArrowTable()}, 0};
10731071
}
10741072

10751073
/// Template function to attach dynamic columns on-the-fly (e.g. inside
10761074
/// process() function). Dynamic columns need to be compatible with the table.
1077-
template <typename T, typename... Cs>
1078-
requires(soa::is_soa_table_like_v<T>)
1075+
template <soa::soaTable T, typename... Cs>
1076+
requires (framework::is_base_of_template_v<o2::soa::DynamicColumn, Cs> && ...)
10791077
auto Attach(T const& table)
10801078
{
1081-
static_assert((framework::is_base_of_template_v<o2::soa::DynamicColumn, Cs> && ...), "You can only attach dynamic columns");
10821079
using output_t = Join<T, o2::soa::Table<OriginEnc{"JOIN"}, Cs...>>;
10831080
return output_t{{table.asArrowTable()}, table.offset()};
10841081
}
10851082

1086-
template <typename T, typename... Cs>
1087-
requires(framework::is_base_of_template_v<TableNG, T>)
1083+
template <soa::ngTable T, typename... Cs>
1084+
requires (framework::is_base_of_template_v<o2::soa::DynamicColumn, Cs> && ...)
10881085
auto Attach(T const& table)
10891086
{
1090-
static_assert((framework::is_base_of_template_v<o2::soa::DynamicColumn, Cs> && ...), "You can only attach dynamic columns");
10911087
using output_t = JoinNG<T, o2::soa::TableNG<o2::aod::Hash<"JOIN"_h>, o2::aod::Hash<"JOIN/0"_h>, o2::aod::Hash<"JOIN"_h>, Cs...>>;
10921088
return output_t{{table.asArrowTable()}, table.offset()};
10931089
}

0 commit comments

Comments
 (0)