P
puzzlecracker
Given,
class X
{
//.....
private:
auto_ptr<Y> y;
};
In this example, if we try to
X a;
X b(a);
or
a=b;
X:X&); constructor will be generated (assignment operator
respectively)? why? Shouldn't be X:const X&) or suit is followed
due to auto_ptr copy constructor of that non-const form?
I thought non-const form wasn't an standard definition of automatically
generated copy constructer.
Thanks
class X
{
//.....
private:
auto_ptr<Y> y;
};
In this example, if we try to
X a;
X b(a);
or
a=b;
X:X&); constructor will be generated (assignment operator
respectively)? why? Shouldn't be X:const X&) or suit is followed
due to auto_ptr copy constructor of that non-const form?
I thought non-const form wasn't an standard definition of automatically
generated copy constructer.
Thanks