c++ - difference between copy constructors? -
i reading c++ primer , piece of code confuses me little. maybe have read before forgotten about.
this code has 2 copy constructors dont know difference between them
class quote { public: quote() = default; quote(const quote&) = default; // <<== 1 quote(quote&&) = default; // <<== , 1 quote& operator=(const quote&) = default; quote& operator=(quote&&) = default; virtual ~quote() = default; }
what difference in general?
and double "&" mean?
they not both copy constructors, first one: quote(const quote&) = default;
. second 1 move constructor, reading on move semantics , c++11.
Comments
Post a Comment