In C++, is there a struct (or class) defined representing a pair of iterators — one the beginning and one the ending iterator? What’s best practice to represent that? std::pair? I know that I can easily build that myself, but I would like to follow common practice.
I search for the following:
template<class It>
struct XXX {
private:
It b;
It e;
public:
It begin () const { return b; }
It end () const { return e; }
// ...
};
Have a look at Boost.Range, in particular boost::iterator_range.