Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-01-06 09:29:50


larsbj_at_[hidden] (Lars Gullik Bjønnes) writes:

> Is boost::bind able to inline delayed function calls?

That's up to the compiler.

> std::vector<std::string> vecstr;
>
> std::for_each(vecstr.begin(), vecstr.end(),
> boost::bind(&std::string::size(), _1));
>
> Will the call to string::size() be inlined (or inlinable)?

In principle, it is inlinable.

> What if I stored the result of the bind in a boost::function before
> giving it to for_each?

In that case, inlining is so unlikely as to be, for all practical
purposes, impossible.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk