Default arg values

  • Thread starter Thread starter fragget
  • Start date Start date
Hi,

There is no need, you can use overload for the same purpouse and therefore
the compiler is simpler.

void T()
{
T( defaultvalue);
}
void T( ParamType param)
{
//...
}

Cheers,
 
...

There is no need, you can use overload for the same purpouse and therefore
the compiler is simpler.

True, but VB.NET supports overloads, and yet also supports optional
parameters.

I have yet to check whether the old C++ "gotcha" applies to virtual
methods, too, where you have to override all of the overloads if you
override one, otherwise the others become "hidden".
 
Back
Top