Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-06-26 14:54:27


"Nico Massi" <desertswat_at_[hidden]> writes:

>> Maybe you want
>>
>> boost::function<int(int,int)> x = boost::bind(f,_1,_2);
>>
>> ??
>>
>
> Better than nothing,
> but i need a variable number of arguments, if it is possible.

boost::function doesn't support dumping arguments, unless I'm
mistaken.

Do this:
   
   template <class T> struct incomplete;
   template <class T>
   int q(T)
   {
       incomplete<T> a;
   }
   int x = q(boost::bind<int>(f,_1,_2));
   
The error message will tell you that incomplete<some_nasty_type> is
incomplete.

Write down that type and use it to declare the result of calling
boost::bind.

-- 
Dave Abrahams
Boost Consulting
http://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