Ownership on move constructor with vector
Hi Refer below code and observe it's output : Between 0. And 1. In output, everything is fine... Object got constructed and copied which will result into destructing of two objects later at end...one for copy (in vector) and one for original (in main) Between 1. And 2. I have a query over here.... Temp object got created and obviously it is to be destroyed once push_back line is executed. So , one constructor and one destructor is fine. Now comes move constructor called in between. It is also expected... But question is that move constructor just transfer ownership so deleted that temp object due to destructor called is allocated to vector... Isn't it? Feel free to ask for any further details on question.. my short query is that move constructor just transfer ownership and that owned object is deleted due to temp object type and hence vector has proper object or not now ? https://code.sololearn.com/cEUT4DecUEtZ/?ref=app