-#ifndef INC_AUTO_HANDLE_H
-#define INC_AUTO_HANDLE_H
+// Copyright 2005 Ben Hutchings <ben@decadent.org.uk>.
+// See the file "COPYING" for licence details.
+
+#ifndef INC_AUTO_HANDLE_HPP
+#define INC_AUTO_HANDLE_HPP
// Like auto_ptr, but for arbitrary "handle" types.
// The parameters are:
explicit auto_handle(handle_type handle)
: handle_(handle)
{}
+ auto_handle(auto_handle & other)
+ : handle_(other.release())
+ {}
auto_handle(ref_type other)
: handle_(other.release())
{}
target_type & target_;
};
-#endif // !INC_AUTO_HANDLE_H
+#endif // !defined(INC_AUTO_HANDLE_HPP)