Allow SOA containers to be used by generic std::ranges algorithms and views
In order to make it possible for SOA collections to interact with std::ranges (which requires eg. that they satisfy the std::ranges::viewable_range concept), make sure that eg. the following assertions hold:
diff --git a/CaloFuture/CaloFutureReco/src/ClusterCovarianceMatrixTool.h b/CaloFuture/CaloFutureReco/src/ClusterCovarianceMatrixTool.h
index 9199ecbab0..4636182d39 100644
--- a/CaloFuture/CaloFutureReco/src/ClusterCovarianceMatrixTool.h
+++ b/CaloFuture/CaloFutureReco/src/ClusterCovarianceMatrixTool.h
@@ -314,6 +314,9 @@ namespace LHCb::Calo {
auto SeeEP = s2E( params, seedID );
using namespace LHCb::CaloDigitStatus;
+ static_assert( std::forward_iterator< decltype( entries.begin() ) > );
+ static_assert( std::ranges::viewable_range< decltype( entries ) > );
+
for ( auto&& [i, entry] : LHCb::range::enumerate( entries ) ) {
/// check the status
if ( entry.status().anyOf(
where entries is of type Event::vector_field<ClusterEntryTag::Entry>. This implies that VectorProxy::iterator (which is the type returned by entries.begin()) must satisfy (at least) the std::forward_iterator concept, which implies that it must be default-constructible and move-assignable. The latter in turn implies eg. one cannot have const data members, or (recursively) data members which themselves have const data members (*)
(*) fun fact: one can write a class with a const data member, and explicitly state that the move-assignment = default, and only when said move assignment is actually needed and the compiler tries to synthesize it does the compiler report that it is implicitly deleted -- i.e. declarating it =default doesn't actually imply it will actually exist... same goes for any other special member function which is declared =default. So one can be fooled by looking at a class and thinking it should be std::semiregular when upon further inspection it isn't...