As part of the development team, I wanted to make sure that the set of functions (and operators) is implemented on the custom iterators that we publish. Using STL iterator types as base types helps, however, for some reason (out of my control), we decided not to use STL compatibility. Iterators are consumed by one team and people in the company.
I wanted to create a template class that uses an iterator type and tests it against a design contract.
For example, I would expect the iterator to execute the operator ++, operator--, and also declare the required typedef.
1> Is it possible to implement such a template template that will fulfill the design contract? perhaps using static_assert?
2> If so, is this a good design?
link: custom iterator
c ++ iterator design
Ram
source share