8 ms·
It is hard to write in Rust style in C++ since many libraries are hostile to it. Iterators require at least two mutable references or mixing mutable and non-mu
by _0w8t 5y ago
It is hard to write in Rust style in C++ since many libraries are hostile to it.
Iterators require at least two mutable references or mixing mutable and non-mutable references. Move-only types require a lot of boiler plate and accidental usage of moved thing is not detected by the compiler. Using std::variant feels like a trolling from the language designers who refused to provide proper type-safe unions into the language.
- eru 5y ago> Using std::variant feels like a trolling from the language designers who refused to provide proper type-safe unions into the language. And, alas, deliberate trolling would be preferable to reality. Deliberate trolling would indicate a conscious design. C++ accumulated cruft over the years in what looks like brownian motion in retrospect, and almost never shed any.