Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to give default value to firstOrDefault() #30

Closed
ghassanpl opened this issue Aug 26, 2019 · 1 comment
Closed

Option to give default value to firstOrDefault() #30

ghassanpl opened this issue Aug 26, 2019 · 1 comment

Comments

@ghassanpl
Copy link

It would be great to be able to give an actual value to firstOrDefault to return when there is no first element. Right now it returns T(), which is not always desirable, and it would be great if there was an overload that takes a T&& or T const& and returns that instead.

@k06a
Copy link
Owner

k06a commented Sep 5, 2019

@ghassanpl just added such optional argument!

@k06a k06a closed this as completed Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants