3 ms·
std::optional doesn't do that though, you can deref an empty optional and the result's the same as deref'ing an empty unique_ptr or a null pointer: UB.
by masklinn 8y ago
std::optional doesn't do that though, you can deref an empty optional and the result's the same as deref'ing an empty unique_ptr or a null pointer: UB.
- basil-rash 8y agoBut it makes you stop and thing before doing so. Thats the whole point.
- masklinn 8y agoIt doesn't do that any more than a pointer