From: Ben Hutchings Date: Thu, 12 Apr 2007 08:08:25 +0000 (+0000) Subject: Added correct copy constructor. Surprisingly, the incorrect default copy constructor... X-Git-Tag: 1.2~10 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=videolink.git;a=commitdiff_plain;h=02df325492bff59972b6f4dc95f4d77a965b405f Added correct copy constructor. Surprisingly, the incorrect default copy constructor was never called so I didn't notice it was still callable. --- 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)