Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
kentonv
on Oct 28, 2020
|
parent
|
context
|
favorite
| on:
Ask HN: Good C++ code bases to read?
kj::Maybe has an `orDefault()` method that is like `.value_or()` but I find that it is almost never useful. You almost always want to execute different logic in the null case, rather than treat it as some default value.
_dh54
on Oct 29, 2020
[–]
Then you can make a quick helper subroutine that adds a monadic interface to optional and you can lint away all non-conforming uses of optional.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: