A function-level try-catch may define a sequence of catch blocks with the entire body. This is…
Month: January 2021
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…
Concept behind Inline Functions and uses
The concept behind an inline functions is to replace each call of that function with its…
Constant Variables : understanding the concept
The compiler keeps the constant variables value of built-in types in symbol table, however, in case…
Why exception in destructor is a bad idea?
exception in destructor are dangerous. Firstly the exception here may cause the abnormal termination of C++…
How to stop copy of object?
To stop copy of object, the class need to hide both copy constructor and the assignment…