Copy constructor is invoke when you initialize an object with another.
In this case, it will be invoked something like this:
LDAPControlSet a;
//do something with 'a'.
LDAPControlSet b=a;//copy constructor invoked with 'a' as the argument
LDAPControlSet c;
c=b;// copy constructor *not* invoked but initialization operator invoked
LDAPControlSet d(a);//explicit invocation of the copy constructor with 'a' as argument
When this copy constructor is called, it simply copies the content of the std::list cs::data to its own std::list data.
In the above example, a is passed as parameter to the copy constructor's parameter cs.
cs.data is the std::list of that argument
and data is the std::list of the own object.
siddhant3s
Practically a Posting Shark
816 posts since Oct 2007
Reputation Points: 1,486
Solved Threads: 140