Abstract

In C++, a constructor is a special function that must be invoked when an object is created. Its objective is to initialize a new object to a valid state before any processing occurs using the object. Constructors appear to have some poorly designed features, due to many reasons such as the condition, which requires that the class constructor’s name must be the same as the class name. These features are explored so that some cautions can be taken when building any C++ compiler. In addition any future modification to the C++ language or the design of any new object-oriented language can avoid these features. The handlers for some of these features are suggested.

Share

COinS