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

References being non-nullable is a huge advantage of references.

If you need the equivalent of a nullable reference, you can just use std::optional<std::reference_wrapper<T>> instead and make the nullability explicit.




If we used std and wanted every type to be 50+ chars long to type, sure. Or we could just use a pointer, which just so happens is a nullable reference.




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

Search: