Wednesday, August 1, 2012

When does a Copy Constructor get invoked?

The following cases give rise to call a copy constructor:
 1. When an object is returned by value
 2. When an object is passed (to a function) by value as an argument
 3. When an object is thrown
 4 .When an object is caught
 5 .When an object is placed in a brace-enclosed initializer list

No comments :