You can assign default values to normal function arguments, so
bool SomeFunction(int arg1 = 3, int arg2 = 4)
can be invoked by any of the following methods.
bool val = SomeFunction();
bool val = SomeFunction(6);
bool val = SomeFunction(6,8);
Is there a way to do something like this (besides creating an unused variable) so that
bool SomeOtherFunction(int arg1, out int argOut)
can be called in one of the following ways:
int outarg;
bool val = SomeOtherFunction(4,outarg);
bool val = SomeOtherFunction(4);
Is this possible, or if not, what are some good workarounds? Thank.
source
share