Boost logo

Boost :

From: Jason Hise (chaos_at_[hidden])
Date: 2005-01-18 17:05:12


I was thinking about the simpler standard containers... specifically
vector, deque, and list, and wondering... would there be any value in
making a generic linear_container class which uses policies to define
the allocation and iteration methods? Specifically, I imagine something
like this:

typedef linear_container < contiguous_iterator, alloc_using_new > vector;
typedef linear_container < double_linked_iterator, alloc_using_new > list;
// etc...

The iterator itself could probably be broken down into smaller traits,
but the idea is that this would make it much easier to add new types of
containers or mix and match existing functionality. Through the
linear_container it would be easy to ensure that all types of containers
had the same interface (push_back, pop_back, etc...) Thoughts/opinion?

-Jason


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk