Yearly Archives

Virtual Copy Constructor

In the virtual constructor idiom we have seen the way to construct an object whose type is not determined...

Virtual Copy Constructor

In the virtual constructor idiom we have seen the way to construct an object whose type is not determined...

Virtual Constructor

Can we make a class constructor virtual in C++ to create polymorphic objects? No. C++ being statically typed (the...

Virtual Constructor

Can we make a class constructor virtual in C++ to create polymorphic objects? No. C++ being statically typed (the...

Copy elision in C++

Copy elision (or Copy omission) is a compiler optimization technique that avoids unnecessary copying of objects. Now a days,...

Copy elision in C++

Copy elision (or Copy omission) is a compiler optimization technique that avoids unnecessary copying of objects. Now a days,...

Playing with Destructors in C++

Predict the output of the below code snippet. #include <iostream> using namespace std; int i; class A { public:...

Playing with Destructors in C++

Predict the output of the below code snippet. #include <iostream> using namespace std; int i; class A { public:...