12.03.2017, 17:24, "Denis Shienkov" <[email protected]>: > Hi all, > > what do you think about using of RAII, e.g. for: > > * Windows: for HANDLE, HKEY and so on. > * POSIX: for fd and so on. > * OSX: for io_registry_entry_t and so on. > > ?? > > As we use C++11 now everywhere, then, maybe can be to add appropriate > RAII functionality e.g. to qcore_unix_p.h, qcore_win_p.h, qcore_mac_p.h files?
Note that unique_ptr with custom deleter is not a good fit for non-pointer resources. Better approach is discussed here: https://accu.org/index.php/journals/2086 > > Please see: > > [1] > http://stackoverflow.com/questions/22775500/is-there-any-raii-file-handle-already-implemented > [2] > http://stackoverflow.com/questions/24611215/one-liner-for-raii-on-non-pointer > [3] > http://stackoverflow.com/questions/14841396/stdunique-ptr-deleters-and-the-win32-api > > and soo on. :) > > BR, > Denis > , > > _______________________________________________ > Development mailing list > [email protected] > http://lists.qt-project.org/mailman/listinfo/development -- Regards, Konstantin _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
