J
Jonathan Wood
I've decided to write a little routine using generics. That is, a method
that takes an out argument of any data type.
However, being the quirky language that C# is, I have the following problem.
The method returns a bool value that indicates if it is successful. If it is
successful, the out argument's value is set. But C# requires that I set the
value of this argument even if I'm not successful.
In the case of an integer, I would just set it to zero. But how can I do
similarly for all the other data types a generic method might be passed?
Thanks.
that takes an out argument of any data type.
However, being the quirky language that C# is, I have the following problem.
The method returns a bool value that indicates if it is successful. If it is
successful, the out argument's value is set. But C# requires that I set the
value of this argument even if I'm not successful.
In the case of an integer, I would just set it to zero. But how can I do
similarly for all the other data types a generic method might be passed?
Thanks.