I'd like to know everyone's opinion about adding (yet) another template
parameter to the STL container classes - one which will determine the
kind of pointer objects the classes will use for handling contained
objects. Something like this will change the vector class from
template< class T,class A=allocator<T> > class vector;
template< class T,class A=allocator<T>,class P=ordinary_ptr<T> > class
Whenever I go for writing an allocator class of my own,
I feel like I should have something to do about the memory pool getting
fragmented. A defrag attempt, however, will make all existing pointers
invalid, and there will be no way for me to change the value of each
and every pointer pointing to a certain place. That can be made
possible if I could somehow instruct STL to use my own pointer objects
to handle all the data they contain.
And not just that, things like copy-on-write would be much simpler to
code if it was implemented. With the different kinds of pointer objects
now emerging out of libraries like boost, this can largely increase the
choice of users of STL.
But the question is, would we *all* like something like this? Or is it
already there or something?
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:email@example.com ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.yqcomputer.com/