S
subramanian100in
If we provide a any non-default ctor, then the compiler doesn't
supply the default ctor even if needed. This behaviour is due the
following reason as per my understanding:
It is for DISALLOWING an object to be created without arguments.
For example, for a class named Test, creating
Test obj;
may not have to be allowed for the particular class Test. Under this
circumstance, we expect a provision from the compiler, not to
supply the default ctor.
Is my understanding correct ?
Or is there any other reason for the compiler not providing the
default ctor when we have defined some ctor ?
Kindly clarify.
Thanks
V.Subramanian
supply the default ctor even if needed. This behaviour is due the
following reason as per my understanding:
It is for DISALLOWING an object to be created without arguments.
For example, for a class named Test, creating
Test obj;
may not have to be allowed for the particular class Test. Under this
circumstance, we expect a provision from the compiler, not to
supply the default ctor.
Is my understanding correct ?
Or is there any other reason for the compiler not providing the
default ctor when we have defined some ctor ?
Kindly clarify.
Thanks
V.Subramanian