X-Git-Url: https://git.decadent.org.uk/gitweb/?p=videolink.git;a=blobdiff_plain;f=auto_handle.hpp;h=64ccd97914604b3c941a8497d901aa48d97e9da0;hp=b9d0b6ba5ce5921f855d8849711e32edf2840083;hb=HEAD;hpb=410c2b9017bc26a7e79269c1f7fc606ad89249bb diff --git a/auto_handle.hpp b/auto_handle.hpp index b9d0b6b..64ccd97 100644 --- a/auto_handle.hpp +++ b/auto_handle.hpp @@ -1,5 +1,8 @@ -#ifndef INC_AUTO_HANDLE_H -#define INC_AUTO_HANDLE_H +// Copyright 2005 Ben Hutchings . +// 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: @@ -25,6 +28,9 @@ public: explicit auto_handle(handle_type handle) : handle_(handle) {} + auto_handle(auto_handle & other) + : handle_(other.release()) + {} auto_handle(ref_type other) : handle_(other.release()) {} @@ -80,4 +86,4 @@ private: target_type & target_; }; -#endif // !INC_AUTO_HANDLE_H +#endif // !defined(INC_AUTO_HANDLE_HPP)