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
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 :
Post a Comment