I'm using gcc-4.9.1 to compile this code that list the contents of directories recursively. I tried to wrap the DIR ptr in a unique_ptr but then it doesn't compile. In clang it throws this error:
/usr/include//c++/4.9.1/tuple:172:13: error: data member instantiated with function type 'int (__dirstream *)'
The default type for the template parameter D is default_delete.
A client-supplied template argument D shall be a function object type, lvalue-reference to function, or lvalue-reference to function object type for which ... <elided> ... - IS
-std=c++1y is a work-around; with -std=c++11, the GNU library on linux appears to be broken.