21 #ifndef SCOPED_RESOURCE_H_INCLUDED
22 #define SCOPED_RESOURCE_H_INCLUDED
59 template<
typename T,
typename ReleasePolicy>
188 void operator()(std::FILE*
f)
const {
if(f !=
nullptr) { std::fclose(f); } }
scoped_resource(resource_type res=resource_type())
Constructor.
scoped_resource & operator=(const scoped_resource &)
void operator()(std::FILE *f) const
A helper policy for scoped_ptr.
void operator()(T *&p) const
This class has identical behavior to scoped_ptr, except it manages heap-allocated arrays instead of h...
scoped_resource< std::FILE *, close_FILE > scoped_FILE
void operator()(T *&p) const
A class template, scoped_resource, designed to implement the Resource Acquisition Is Initialization (...
virtual ~scoped_resource()
The destructor is the main point in this class.
A class which implements an approximation of template typedef scoped_resource scoped_ptr;.
resource_type operator->() const
This function provides convenient direct access to the -> operator if the underlying resource is a po...
This class specializes the scoped_resource to implement scoped FILEs.
A helper policy for scoped_array.
void assign(const resource_type &o)
ReleasePolicy release_type
scoped_resource(const scoped_resource &)