Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > My lallocator<T>

Reply
Thread Tools

My lallocator<T>

 
 
kuyper@wizard.net
Guest
Posts: n/a
 
      11-09-2005
"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
together properly.

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use (E-Mail Removed) ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments