Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wouldn't use the word "missing". I believe several of the Rust language designers are very familiar with C++, and to say that something is missing implies it was an oversight or an accident, or maybe they'll get to it later. Instead, I believe they don't value some of the powerful features in C++ and ignored the fact that other people find those features very valuable.

Here's an example that has bitten me several times now. Try and implement the following C++14 code in Rust:

    template<class T>
    struct Something { T a, b; };

    template<class S, class T>
    auto operator *(const S& x, const Something<T>& y) {
        return Something<decltype(S() * T())> {
            x*y.a, x*y.b
        };
    }
There are ugly workarounds, and I'm certain they have their reasons, but it's so much simpler and cleaner in C++.


Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: