From 0d168f7ecdd875e739d7e3fb0df7348bc5d7deb0 Mon Sep 17 00:00:00 2001 From: OBATA Akio Date: Sat, 22 Jan 2022 14:34:09 +0900 Subject: Change to use c++11 unique_ptr instead of deprecated auto_ptr Signed-off-by: OBATA Akio --- kghostview/dscparse/dscparse_adapter.h | 54 ++-------------------------------- 1 file changed, 2 insertions(+), 52 deletions(-) (limited to 'kghostview/dscparse/dscparse_adapter.h') diff --git a/kghostview/dscparse/dscparse_adapter.h b/kghostview/dscparse/dscparse_adapter.h index 05b7e637..77855972 100644 --- a/kghostview/dscparse/dscparse_adapter.h +++ b/kghostview/dscparse/dscparse_adapter.h @@ -28,51 +28,6 @@ #include "dscparse.h" -#if defined(__GNUC__) -#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 93) -/* - * We add a quick 'n' dirty inline implementation of auto_ptr for older - * releases of GCC, which don't include an auto_ptr implementation in - * . - */ - -template class auto_ptr { -private: - T* _ptr; - -public: - typedef T element_type; - explicit auto_ptr(T* p = 0) : _ptr(p) {} - auto_ptr(auto_ptr& a) : _ptr(a.release()) {} - template auto_ptr(auto_ptr& a) : _ptr(a.release()) {} - auto_ptr& operator=(auto_ptr& a) { - if (&a != this) { - delete _ptr; - _ptr = a.release(); - } - return *this; - } - template - auto_ptr& operator=(auto_ptr& a) { - if (a.get() != this->get()) { - delete _ptr; - _ptr = a.release(); - } - return *this; - } - ~auto_ptr() { delete _ptr; } - - T& operator*() const { return *_ptr; } - T* operator->() const { return _ptr; } - T* get() const { return _ptr; } - T* release() { T* tmp = _ptr; _ptr = 0; return tmp; } - void reset(T* p = 0) { delete _ptr; _ptr = p; } -}; - -#endif -#endif - - class KDSCBBOX { public: @@ -304,13 +259,8 @@ public: CDSCMEDIA** media() const; const CDSCMEDIA* page_media() const; -#if defined(__GNUC__) && (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 93)) - auto_ptr bbox() const; - auto_ptr page_bbox() const; -#else - std::auto_ptr bbox() const; - std::auto_ptr page_bbox() const; -#endif + std::unique_ptr bbox() const; + std::unique_ptr page_bbox() const; // CDSCDOSEPS *doseps; -- cgit v1.2.1