[boost.function] member function with default values for parameters

Folks,
What is wrong with the code below:
class SomeClass
{
public:
int doSomething(int i=0)
{
return ++i;
}
};
boost::function2

Yan Drugalya wrote:
What is wrong with the code below:
class SomeClass { public: int doSomething(int i=0) { return ++i; } };
boost::function2
func = &SomeClass::doSomething; SomeClass sc; std::cout << func(&sc, 1); Currently I'm having following error: ... If I remove default value for parameter i - everything compiles. Complier: VisualAge 7.0
I'm not sure anything's wrong with your code. It compiles and runs fine with: i686-apple-darwin9-g++-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)
participants (2)
-
Nat Goodspeed
-
Yan Drugalya