News for hackers. Stuff that matters.
Re:Some were meant for C [pdf] by MereInterest on Wednesday June 21, 2023 @07:56PM (#36426429)
I get similarly frustrated at the implementation of operator-> and operator* in std::optional. In what world would I want to provide accessors with no more safety than a raw pointer?

Edit: I was looking it up just to make sure I remembered it correctly, and there’s been a recent change that makes it worse. The operator-> and operator* on std::optional are now marked noexcept, so implementations are forbidden from making the accessors safe.

https://cplusplus.github.io/LWG/issue2762

There are no comments on this comment yet.