[Development] Use RAII for non-pointer resources
Denis Shienkov
denis.shienkov at gmail.com
Sun Mar 12 15:23:53 CET 2017
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?
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20170312/76b6eafd/attachment.html>
More information about the Development
mailing list