You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently BaseIterator defines the difference_type as Position. Unfortunately many Composite-derived classes define Position as Composite*, which makes no sense as a difference_type. This breaks compatibility of our iterators with many STL algorithms.
For example the following code does not compile:
#include<BALL/KERNEL/protein.h>
#include<algorithm>usingnamespaceBALL;intmain() {
Protein p;
std::count_if(p.beginResidue(), p.endResidue(),
std::mem_fn(&Residue::isSelected));
}
Changing BaseIterator::difference_type unconditionally to std::ptrdiff_t (the STL default) fixes this. However I am not certain that this is the correct fix. Any ideas?
The text was updated successfully, but these errors were encountered:
Currently BaseIterator defines the
difference_type
asPosition
. Unfortunately manyComposite
-derived classes define Position asComposite*
, which makes no sense as a difference_type. This breaks compatibility of our iterators with many STL algorithms.For example the following code does not compile:
Changing
BaseIterator::difference_type
unconditionally tostd::ptrdiff_t
(the STL default) fixes this. However I am not certain that this is the correct fix. Any ideas?The text was updated successfully, but these errors were encountered: