Boost logo

Boost Users :

Subject: [Boost-users] Default argument values with boost::function
From: Artyom (sneg.vx_at_[hidden])
Date: 2009-04-30 11:19:28


Hi,

Is there any way to set default argument values with Boost::Function? On
VS2008 SP1 I tried:

boost::function< void( unsigned i = 1 ) > increment;

But this didn't work. Code such as increment( 1 ); compiles OK but if
you try doing increment(); the following compiler error is triggered:

error C2064: term does not evaluate to a function taking 0 arguments
class does not define an 'operator()' or a user defined conversion
operator to a pointer-to-function or reference-to-function that takes
appropriate number of arguments

Thanks,
Artyom


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net