Are there some drawbacks of such implementation of copy-constructor?
Foo::Foo(const Foo& i_foo)
{
*this = i_foo;
}
As I remember, it was recommend in some book to call copy constructor from assignment operator and use well-known swap trick, but I don't remember, why...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…