|
Boost : |
From: Howard Hinnant (hinnant_at_[hidden])
Date: 2004-03-11 17:52:44
On Mar 11, 2004, at 4:06 PM, Douglas Gregor wrote:
> On Thursday 11 March 2004 03:14 pm, David Abrahams wrote:
>> Just to throw more darts at the idea, building the composite function
>> object could be an expensive way to arrive at an immediate bool result
>> if copying the function objects was a nontrivial operation.
>
> Thoughout the STL is the implicit assumption that function objects are
> cheap
> to copy. We're not making any new assumptions here.
Unfortunately I wouldn't classify function<...> as cheap to copy. It's
not terribly expensive either, but it does call new during the copy
ctor (unless I'm just looking at a flawed implementation - my own ;-)
). But bind should be cheap to copy as long as its contained functors
are cheap.
-Howard
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk