// Copyright {Jagger Software Limited} 2003 #ifndef OWNERSHIP_FCLOSER_INCLUDED #define OWNERSHIP_FCLOSER_INCLUDED #include namespace ownership { struct fcloser // <> { void operator()(FILE * to_close) const; }; } #endif //------------------------------------------------- // Example of use #if 0 #include "ownership/scoped.hpp" #include "ownership/fcloser.hpp" #include "c/stdio.hpp" using namespace ::ownership; int main(int argc, char * argv[]) { scoped stream(::c::fopen(argv[1], "rb")); //... return 0; } #endif