mardi 28 avril 2015

Does adding a move constructor break binary compatibility?

If I add a move-constructor (or move-assignment operator) to my library, will I break binary-compatibility? Can that addition break a user's code in any way?

class Foo {
public:
  Foo();
  Foo(Foo const&);
  Foo& operator=(Foo const&);

// new methods:
  Foo(Foo&&);
  Foo& operator=(Foo&&);
};

Aucun commentaire:

Enregistrer un commentaire