jeudi 5 mars 2015

call rvalue-constructor from an lvalue-constructor

I'd like to provide a constructor definition only once – for both lvalue and rvalue.



class A;

class B {
B(A const& a): B(A(a)) {}
B(A&&);
};


Is B::B(A&&) guaranteed to be called by B::B(A const&)?


Aucun commentaire:

Enregistrer un commentaire