TryGetValue method

T TryGetValue(
  1. T failureValue
)

Returns the success value, and sets the out parameter to either the specified failure value of T or the successful parse result value.

  • failureValue: The 'default' value to set in result if parsing failed.
  • result: The parameter to store the parsed value in on success.

Returns: True if this parse result was successful, or false otherwise.

Implementation

T TryGetValue(T failureValue) {
  // todo: This did the true/false return _value ... this might alter how it's used (no longer doing that)
  return success ? _value : failureValue;
}