3 ms·
`x->foo()` in C++ often isn't just "crashy", but undefined behavior. See https://en.cppreference.com/w/cpp/utility/optional/operator https://en.cppreference.co
by Taywee 4y ago
`x->foo()` in C++ often isn't just "crashy", but undefined behavior. See https://en.cppreference.com/w/cpp/utility/optional/operator https://en.cppreference.com/w/cpp/utility/optional/operator*
> The behavior is undefined if *this does not contain a value.
I'll take crashes over "probably does the wrong thing" any day.