It tried something like this, which doesn't work. Is there a way to get a similar effect?
class A
{
public:
int foo();
void bar(int b = foo());
};
Yes. Overload the function and call the member-function in it.
void bar() { bar(foo()); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With