Skip to content
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