3 ms·
std::optional don't enforce exhaustiveness; you can get away with accidentally unwrapping it. In Rust this requires an explicit check or explicit call to unwrap
by Manishearth 9y ago
std::optional don't enforce exhaustiveness; you can get away with accidentally unwrapping it. In Rust this requires an explicit check or explicit call to unwrap()/expect().
To me, this is super important. But yeah, it's still a good thing to have!
IIRC there are TMP-implemented versions of this that are safer (though a bit ugly to use) though.