3 ms·
It seems like that wasn't the case for the proposed C++ variant. It seems like you would have to use some sort of sentinel value to discriminate between None an
by vvanders 11y ago
It seems like that wasn't the case for the proposed C++ variant. It seems like you would have to use some sort of sentinel value to discriminate between None and Some(or virtual which is even worse).
Rust explicitly omits the sentinel value and leaves it to the compiler so that it can decide how to optimize best.
- detrino 11y agoI'm just saying you wouldn't use std::variant<T star>, you'd just use T star. Also C++ has the meta-programming capabilities to special variant for pointers. edit: replaced * with star to defeat italicizer.