As a part of a team of developers, I wanted to ensure that a set of functions (and operators) are implemented on the custom iterators that we publish. Using STL iterator types as base types help, however due to some reasons(outside my control) we decide not to enforce STL compatibility. The iterators are consumed by the same team and by people across the company.
I wanted to design a template class that consumes the iterator type and tests against the design contract.
For example, I would expect an iterator to implement a operator++ , operator-- and also declare the required typedefs.
1> Is it possible to implement such a template class that enforces the design contract ? probably using static_assert ?
2> If yes, is this a good design ?
reference : custom iterator