Boost logo

Boost :

Subject: Re: [boost] [function] does calling boost::function from boost::function involve nested virtual calls?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-11-07 00:55:32


AMDG

On 11/6/2010 9:02 PM, Mostafa wrote:
> Hi all,
>
> Correct me if I'm wrong, using boost::function involves a virtual
> function call.

Not exactly, but close enough for practical purposes.

> If so, then does nesting boost::function calls result in nested
> (multiple) virtual function calls?

Yes.

> For example:
>
> int foo(float);
>
> boost::function<int (float)> f1 = foo;
> boost::function<double (int)> f2 = f1;
>
> Does f2(5) result in two virtual functions being called on the part of
> boost::function?
>
> (I couldn't find the answer in the documentation and reading the
> source code I got lost in the macros.)

In Christ,
Steven Watanabe


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