{This is a second attempt to post}

With a help of boost::dynamic_any::call operation (not yet implemented) it's 
possible to use boost::dynamic_any::any instead of Boost.Function. Though 
this new solution is less specialized and probably slower then 
Boost.Function it has one advantage demonstrated in the example below:


typedef boost::dynamic_any<
    boost::mpl::list<
        boost::dynamic_any::call<void (int &)>,
        boost::dynamic_any::call<void (double &)>
    >
> flexible_function; // 2 in 1!


int main()
{
    flexible_function f;
    f = ++_1; // increment for int and double

    int i = 2;
    f(i); // ++i

    double d = 3;
    f(d); // ++d
}    

-- 
Alexander Nasonov
Remove - m y c o p from my e-mail address for timely response

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to