My class has a method that takes a class ( data class) as parameter and I want to put a default value if the caller won't supply it like
class::function(int a = 3);
class::function(int a = 3);
To copy to clipboard, switch view to plain text mode
kinda thing.
so here's what i did
class A
{
public:
class B
{
int x;
};
A()
{ defaultB.x = 3};
run(B options = defaultB); // compiler complains about non-static defaultB which is correct
private:
B defaultB;
};
class A
{
public:
class B
{
int x;
};
A()
{ defaultB.x = 3};
run(B options = defaultB); // compiler complains about non-static defaultB which is correct
private:
B defaultB;
};
To copy to clipboard, switch view to plain text mode
do you guys know of any way that i can implement default on my methods passing a class ?
baray98
Bookmarks