signature of Copy Constructor for class X
is
X(X&)
Can we declare it as
X(const X&)
Last edited on
Not only can you.
But you should (and you might even have to ... I'm not sure the first one is really a copy constructor)
The copy constructor has signature
X( const X& );
As Disch said, your first example is not a copy constructor.
Thanks @Disch and @Jsmith