lundi 29 juin 2015

move constructor along copy constructor [duplicate]

This question already has an answer here:

ist is possible to have a copy constructor implemented along with a move constructor? If I would have the following abstract class structure:

template<typename T>
class A
{
  public:
    A<T>();
    A<T>(const& T);
    A<T>(T&&);
  // ...
}

  1. Is it possible to have both, copy - and move constructor
  2. How would a call of both of them look like? Is there a special syntax?
  3. How is the compiler differing between both calls?

Aucun commentaire:

Enregistrer un commentaire