C++0x: rvalue references, std::vector::push_back, move semantics

Sebastian Mach phresnel@googlemail.com
Wed Feb 3 14:28:00 GMT 2010


Minor addendum: I post this here because I am not sure if this
a C++0x "problem", a gcc one, or none at all.


Also, of course it should be ...

template <typename A, typename B>
vint operator | (A &&lhs, A &&rhs) {
        std::cout << "operator A|B{{" << std::endl;
        vint ret;
        ret.push_back(std::forward<A>(lhs));
        ret.push_back(std::forward<B>(rhs));
        std::cout << "}}" << std::endl;
        return ret;
}

... but the results are the same.



More information about the Gcc-help mailing list