|
Boost : |
Subject: Re: [boost] [function] improvements/proposals
From: Domagoj Saric (dsaritz_at_[hidden])
Date: 2010-02-27 05:26:49
"OvermindDL1" <overminddl1_at_[hidden]> wrote in message
news:3f49a9f41002262044hd62d028x36c870906a19c058_at_mail.gmail.com...
> Actually, the only reason they outperform boost::function is because
> boost::function adds in extra assembly code for a comparison check (to
> null, if true it throws an exception).
Actually there are more issues, that one is just one of the more serious
ones...(I've gone about all of them in much greater detail previously...but not
to repeat myself...)
> If that is removed (perhaps by
> a policy, I certainly know that most of my function would never be
> empty, would even be nice if the function defaulted to an empty
> function if empty instead), then boost::function becomes even faster.
As Steven pointed out this can be done w/o policies, with a nul-object (that is
the way I did it)...But I added a policy to specify the nul-object, that is to
choose what it actually does (throw, nop, ....)...
> I have actually started to take a liking to Boost.Variant for function
> callbacks (if I know what they can be), it inlines it and the function
> pointer call disappears. :)
lol ... 'dirty'/twisted, me likes ;-)
-- "What Huxley teaches is that in the age of advanced technology, spiritual devastation is more likely to come from an enemy with a smiling face than from one whose countenance exudes suspicion and hate." Neil Postman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk