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

Could you show an example for what you meant in #6?


Sure.

    struct A {
        A (A const&); // copy constructor;
        A (A&&); // move constructor
        template <typename T> A (T&&); // template constructor
    };

    int main() {
        A a1;
        A a2(a1); // calls the template constructor because a1 is an lvalue
    }




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

Search: