Why invest in a constructor when it is initialized in code?
Thus, the implementation is safe. Suppose you have this code:
SslClient::SslClient(QWidget *parent)
: QWidget(parent), socket(0), padLock((QToolButton*)(0x0BEEF)), executingDialog(false) {
throw std::exception();
padLock = new QToolButton;
}
padLock, , undefined. , nullptr ( free(NULL) C!). , , . , - . , new , . new ( : std::bad_alloc , ).
++, , std::unique_ptr QScopedPointer, . , . RAII . , , ++ , .
++ RAII . , (, Java, #, F #, Python, OCaml Common Lisp), with_resource , . OCaml, Java Python Python . , , ++, , , -, , . ++ RAII.