|
Boost : |
From: Lassi Tuura (lassi.tuura_at_[hidden])
Date: 2007-08-11 09:20:30
Hi,
> Libraries that produce needless copies are simply ill-designed, and
> thus
> it is true great parts of the standard library are),
Well... Having had to recent pleasure to find code like this:
bool foo::check(T *obj) const
{
std::string name = obj->name();
bool value = (name == "foo");
value = value || (name == "bar");
value = value || (name == "foobar");
value = value || (name == "zoinc");
value = value || (name == "barfy");
value = value || (name == "zoobie");
value = value || (name == "ayeyei");
return value;
}
That was one of the contributors to ~800'000 memory allocation calls
per second. It was called... often.
I'd say there's something a bit more fundamental going on here than
_just_ a library design issue :-) No class can be all things to all
users.
Lassi
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk