
"Jason Hise" wrote:
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?
Maybe Boost.Multi Index Container is what you are looking for. /Pavel