Comments on interface design
Classes which represent sequences and provide iterators should be standard-conforming. This makes the sequences compatible with the C++ stdlib and range-based for loops, and perhaps most importantly, it makes the interface easier to learn.
- Classes which represent iterable sequences should provide the standard
end()and their const versions. For example, Framework/StackInterface/Stack.h implements
StackIterator. There is no need to repeat the class name in the iterator, because it is a nested type of the Stack already. Just calling this
iteratoris compatible with the DRY principle and standard conforming. Valid exceptions are classes which provide iterators over different things, when it is ambiguous to what iterator the alias
- Custom iterators should be standard-conforming. For example,Framework/StackIteratorInterface.hpp is not implementing a standard-compatible iterator interface. For one, it is not specified whether this iterator is random access or forward or bidirectional, etc. Boost provides CRTP classes which helps to implement a standard-conforming iterators https://www.boost.org/doc/libs/1_70_0/libs/iterator/doc/html/index.html