diff --git a/Framework/Core/include/Framework/ASoA.h b/Framework/Core/include/Framework/ASoA.h index 7b0b69ec8941f..c6fabe78c6310 100644 --- a/Framework/Core/include/Framework/ASoA.h +++ b/Framework/Core/include/Framework/ASoA.h @@ -1024,6 +1024,9 @@ concept can_bind = requires(T&& t) { { t.B::mColumnIterator }; }; +template +concept WithIndexColumns = (is_indexing_column || ...); + template struct TableIterator : IP, C... { public: @@ -1031,8 +1034,6 @@ struct TableIterator : IP, C... { using policy_t = IP; using all_columns = framework::pack; using persistent_columns_t = framework::selected_pack; - using indexing_columns_t = framework::selected_pack; - constexpr inline static bool has_index_v = framework::pack_size(indexing_columns_t{}) > 0; using external_index_columns_t = framework::selected_pack; using internal_index_columns_t = framework::selected_pack; using bindings_pack_t = decltype([](framework::pack) -> framework::pack {}(external_index_columns_t{})); // decltype(extractBindings(external_index_columns_t{})); @@ -1040,15 +1041,21 @@ struct TableIterator : IP, C... { TableIterator(arrow::ChunkedArray* columnData[sizeof...(C)], IP&& policy) : IP{policy}, C(columnData[framework::has_type_at_v(all_columns{})])... + { + bind(); + } + + TableIterator(arrow::ChunkedArray* columnData[sizeof...(C)], IP&& policy) + requires(WithIndexColumns) + : IP{policy}, + C(columnData[framework::has_type_at_v(all_columns{})])... { bind(); // In case we have an index column might need to constrain the actual // number of rows in the view to the range provided by the index. // FIXME: we should really understand what happens to an index when we // have a RowViewFiltered. - if constexpr (has_index_v) { - this->limitRange(this->rangeStart(), this->rangeEnd()); - } + this->limitRange(this->rangeStart(), this->rangeEnd()); } TableIterator() = default; @@ -1192,7 +1199,7 @@ struct TableIterator : IP, C... { [this](T*) -> void {}, }; (f(static_cast(nullptr)), ...); - if constexpr (has_index_v) { + if constexpr (WithIndexColumns) { this->setIndices(this->getIndices()); this->setOffsets(this->getOffsets()); }