diff --git a/Framework/Core/include/Framework/ASoA.h b/Framework/Core/include/Framework/ASoA.h index 4273c79a57eed..fa9888a698790 100644 --- a/Framework/Core/include/Framework/ASoA.h +++ b/Framework/Core/include/Framework/ASoA.h @@ -781,6 +781,11 @@ struct ColumnDataHolder { arrow::ChunkedArray* second; }; +template +concept CanBind = requires(T&& t) { + { t.B::mColumnIterator }; +}; + template struct RowViewCore : public IP, C... { public: @@ -964,7 +969,27 @@ struct RowViewCore : public IP, C... { template auto bindDynamicColumn(framework::pack) { - DC::boundIterators = std::make_tuple(&(B::mColumnIterator)...); + DC::boundIterators = std::make_tuple(getDynamicBinding()...); + } + + // Sometimes dynamic columns are defined for tables in + // the hope that it will be joined / extended with another one which provides + // the full set of bindings. This is to avoid a compilation + // error if constructor for the table or any other thing involving a missing + // binding is preinstanciated. + template + requires(CanBind) + decltype(auto) getDynamicBinding() + { + static_assert(std::is_same_v(this)->mColumnIterator)), std::decay_t*>, "foo"); + return &(static_cast(this)->mColumnIterator); + //return static_cast*>(nullptr); + } + + template + decltype(auto) getDynamicBinding() + { + return static_cast*>(nullptr); } };