Skip to content

TryGetValue_returns_false_if_source_is_empty_and_out_parameter_is_null #482

Answered by vkhorikov
xavierjohn asked this question in Q&A
Discussion options

You must be logged in to vote

This is probably not a useful scenario in general, but still, there could be usecases where you are using Maybe<T> without being able to control the type of T (which may turn into int?).

Also, I don't think there's a way to restrict the use a generic type to non-nullable types only. ? is a shortcut for Nullable<T> which itself is a struct.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by xavierjohn
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants