Copy constructor and creation of temporary object C++ Let me use as example a vector object but it applies to any object.