
11 Mar
2004
11 Mar
'04
10:52 p.m.
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