3 ms·
But it is different because you can't dereference x without the check. In other words, you can't really make an accident. My language has maybe<T>, and I have
by mathgladiator 3y ago
But it is different because you can't dereference x without the check. In other words, you can't really make an accident.
My language has maybe<T>, and I have automatic "re-wrapping" (not sure if there is a better term). where
For example, with
record R { int x; }
maybe<R> r;
I can access r.x yet the type is maybe<int>.
- 0x457 3y agoTrue. I'm just playing devil's advocate here. In unsafe rust, technically deref you can for types that have niche optimization.