Can constructor call another constructor in c++?

Not before C++11.

Extract the common functionality into a separate function instead. I usually name this function construct().

The “so-called” second call would compile, but has a different meaning in C++: it would construct a new object, a temporary, which will then be instantly deleted at the end of the statement. So, no.

A destructor, however, can be called without a problem.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)