Boost logo

Boost :

Subject: [boost] [function] does calling boost::function from boost::function involve nested virtual calls?
From: Mostafa (mostafa_working_away_at_[hidden])
Date: 2010-11-07 00:02:52

Hi all,

Correct me if I'm wrong, using boost::function involves a virtual function
call. If so, then does nesting boost::function calls result in nested
(multiple) virtual function calls? 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

(I couldn't find the answer in the documentation and reading the source
code I got lost in the macros.)



Boost list run by bdawes at, gregod at, cpdaniel at, john at