[Development] Making QScopedPointer scoped (again)

Dmitry Ashkadov dmitry.ashkadov at gmail.com
Thu Sep 5 09:28:33 CEST 2013


05.09.2013 04:00, Thiago Macieira пишет:
> We should add QUniquePointer only when we find the need for it in Qt code,
> which by our rules cannot depend on the C++11 standard library features.

Maybe I don't understand something, but Does Qt use QScopedPointer in 
its implementation? Why Qt doesn't use QScopedPointer, and 
QScopedPointer may be deprecated? Consider next example:

void fun()
{
QScopedPointer p(…);
…
QFile file(…);
if (!file.open()) {
// something went wrong=> process error
…
return; // memory handled by pwill be released automatically
}
…
}



More information about the Development mailing list