Recommendation for variable declaration in C++

In C++, the objects may need extra information to be initialized properly. The variable declaration need…

Rule of Three

Rule of three corresponds to automatic generation of 3 special member functions – constructor, destructor and…

How pointer to member functions in C++ is different ?

The pointer to member functions in C++ is a special concept. This is different from ordinary…

Understanding exception specification for functions

The exception specification is part of function signature and it tells which type of exceptions the…

Function Level Try catch blocks

A function-level try-catch may define a sequence of catch blocks with the entire body. This is…

What happens when exception thrown in constructor?

This means if exception in constructor is thrown then corresponding destructor will not be called. Therefore,…

Catch an exception with reference-parameter

the catch block should catch an exception by declaring its parameter as reference type and not…

Basics of exception handling

Exception Handling: When the program encounters an unexpected situation where it do not know how to…

What is an explicit constructor ?

To stop this automatic conversion, the class should use explicit constructor. Here, constructor is preceded by…

Understanding the order of constructors and destructors

the order of constructors and destructors call for member objects is completely unrelated to the order…

Copy Constructor in C++: Understanding the details

Copy constructor is a special constructor which can construct from and existing object. If the class…

How to overload placement new operator?

The placement syntax can also be overloaded so that now the overloaded operator new can take…