I am trying to create a class in which the user can modify member variables to change the default arguments of their member functions.
class Class
{
public int Member;
public void Method(int Argument = Member)
{
}
}
My workaround so far has been to use magic numbers, which are obviously not perfect.
public void Method(int Argument = 123)
{
int RealArgument;
if (Argument == 123) RealArgument = Member;
else RealArgument = Argument;
}
Is there a better way, or am I sticking with this “hacked” solution?
Maxpm source
share