Does the standard library or Boost have some kind of base utility class for populating a custom STL-compatible sequence with the required typedefs (size_type, value_type, etc.). I am thinking of something like boost :: iterator_facade , but for containers.
I was about to curl up, but I wanted to make sure that this did not exist.
UPDATE:
This is the base utility class I came across in case anyone finds this useful:
template <class C>
class ContainerAdapter
{
public:
typedef C::value_type value_type;
typedef C::reference reference;
typedef C::const_reference const_reference;
typedef C::const_iterator iterator;
typedef C::const_iterator const_iterator;
typedef C::difference_type difference_type;
typedef C::size_type size_type;
protected:
typedef C::container_type;
};
class MyCustomContainer : public ContainerAdapter< std::vector<int> >
{
...
};
The ContainerAdapter simply βechoesβ the nested typedefs of the container underlying the container. Nothing really.