My lallocator<T>

K

kuyper

Oliver S. said:
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
together properly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top