H
hall
Hi.
I'd like to use a data member as a default argument to a member
function, something like this:
class A{
public:
int data;
A(): data(0) { };
fun(int arg=data){ /*function body*/ };
};
The code above will not compile (my borlad compiler says: member A::data
cannot be used without an object), but is there a way to achieve this
(without too much code and too much impact on speed of execution)?
regards
hall
I'd like to use a data member as a default argument to a member
function, something like this:
class A{
public:
int data;
A(): data(0) { };
fun(int arg=data){ /*function body*/ };
};
The code above will not compile (my borlad compiler says: member A::data
cannot be used without an object), but is there a way to achieve this
(without too much code and too much impact on speed of execution)?
regards
hall