1.

Can constructor be virtual and what about destructor? If yes why and if not why?

Answer»

One of the LATEST FEATURES of C++11 are a Move CONSTRUCTOR and a Move Assignment operator. We KNOW that a Copy Constructor and a Copy Assignment is used to make a copy of one object to another, the Move Constructor and Move Assignment is to shift the ownership of the resources from one object to other. This is less expensive that object to object copy. A Move Constructor and Move Assignment operator is not provided by the COMPILER by default and one needs to implement the same.



Discussion

No Comment Found