"Oliver S." wrote:
> > The most likely reason for doing something like that is because
> > the string/container class that they are instantiating with your
> > performance-enhancing allocator was written by someone with other
> > objectives.
> Why should someone not see this objective when the only
> purpose of my allocator is to enhance the performance?
I didn't say they would not "see your objective", merely that they
wouldn't share it. However, why are you assuming that the
string/container class's implementor has even heard of your allocator?
Obviously, the person who writes the code that explicitly refers to
your allocator is aware of it, and presumably chose it because
performance is a high priority with them. However, the string/container
class that they instantiate with your allocator class might have been
written by some other person entirely, someone who knows nothing about
your allocator class.
That's the whole purpose of the allocator requirements and the
container requirements in the standard. If one person claims that class
Allocator meets the allocator requirements, and another person claims
that template class Container meets the requirements for one of the
standard containers, and a third person claims that class T meets that
requirements for a contained type, then a fourth person should be able
to use Container<T,Allocator> without having to talk with any of the
other three people about whether the three types were written to work
[ 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.jamesd.demon.co.uk/csc/faq.html ]