A
Anonymous
Just need to clarify the order at which assignement takes place
class A
{
public:
A(){ std::cout << "default ctor"; }
A(const A& a){ std::cout << "copy ctor"; }
A& operator= (const A& a){ std::cout << "assignment operator"; }
~A(){}
};
int main(int argc, char* argv[])
{
A a ; // default ctor
A b(a) ; // copy ctor
A c = b ; // default ctor THEN assignemnt OR copy ctor ???
}
OT:
I am using the clunky MSVC IDE, so am unable to quickly compile and test
this (without creating a project in the IDE) - incidentally, if anyone
knows how to compile litle code snippets like this using a command line
compiler that runs on Windoze (possibly the VC complier?) - without
needing invoking the IDE/ requiring a project etc, ala gcc - please post
instructions etc, so in future I can carry out such tests myself )
class A
{
public:
A(){ std::cout << "default ctor"; }
A(const A& a){ std::cout << "copy ctor"; }
A& operator= (const A& a){ std::cout << "assignment operator"; }
~A(){}
};
int main(int argc, char* argv[])
{
A a ; // default ctor
A b(a) ; // copy ctor
A c = b ; // default ctor THEN assignemnt OR copy ctor ???
}
OT:
I am using the clunky MSVC IDE, so am unable to quickly compile and test
this (without creating a project in the IDE) - incidentally, if anyone
knows how to compile litle code snippets like this using a command line
compiler that runs on Windoze (possibly the VC complier?) - without
needing invoking the IDE/ requiring a project etc, ala gcc - please post
instructions etc, so in future I can carry out such tests myself )