AIDASoft / podio

PODIO
GNU General Public License v3.0
24 stars 59 forks source link

CollectionIterator does not fully satisfy iterator concept #150

Open tmadlener opened 3 years ago

tmadlener commented 3 years ago

It currently seems to be impossible to use podio collections with the STL algorithms operating on iterator ranges, because the CollectionIterator does not provide enough information, leading the compiler complaining about (greatly abbreviated to the crucial line):

/usr/include/c++/9/bits/stl_iterator_base_types.h:205:5: error: no type named ‘iterator_category’ in ‘struct std::iterator_traits<edm4hep::MCRecoParticleAssociationCollectionIterator>’

I think having a correctly implemented const-iterator is something we should aim for, to at least enable the usage of STL algorithms that can be used on ranges of const-iterators.

whit2333 commented 3 years ago

IMO, this is critical. I have almost given up and started using the raw *Data classes which are not accessible otherwise.