Custom Containers & Iterators for STL-Friendly Code
By Ethan McCallum, March 01, 2005
Need to add functionality to containers to make classes more STL friendly, or create new containers and iterators from scratch to make legacy code available to STL algorithms? Here's how.
March, 2005: Custom Containers & Iterators for STL-Friendly Code
Listing 3
template<class Category, class T, class Distance =
ptrdiff_t, class Pointer = T*, class Reference = T&>
struct std::iterator {
typedef T value_type;
typedef Distance difference_type;
typedef Pointer pointer;
typedef Reference reference;
typedef Category iterator_category;
}