Hacker News new | past | comments | ask | show | jobs | submit login

Which more or less removes any benefit for using optional, unfortunately.



Yes for this case, but that's just because it's a bad example for comparing the performance of optional, because the code is doing things that have very different performance characteristics.

There are plenty of other cases though where it is useful to use optional (e.g. instead of passing/returning a naked pointer which may or may not be null) and in those cases use of optional will have little/no overhead.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: