20 Nov
2014
20 Nov
'14
8:10 a.m.
On Wed, Nov 19, 2014 at 1:47 PM, Sylvester-Bradley, Gareth
shared_ptr/unique_ptr work fine for me with FILE*, one only has to write a deleter. A dedicated class would be needed for POSIX file descriptors though.
Peter Sommerlad and Andrew L. Sandoval's unique_resource RAII proposal uses both FILE* and POSIX file descriptors as examples. I think this is the latest revision: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4189.pdf
It does solve the RAII part but it doesn't provide a standard interface for native IO. -- Olaf