From 2a1077dae34a5e7f2a44971186c4a4b11dd707d4 Mon Sep 17 00:00:00 2001 From: mfranz Date: Wed, 21 Jun 2006 09:36:15 +0000 Subject: [PATCH] - auto_ptr.hxx: not used anywhere; functionally replaced by simgear/structure/SGSharedPtr.hxx - fg_stl_config.h: only used by obsolete auto_ptr.hxx --- src/Include/Makefile.am | 2 - src/Include/auto_ptr.hxx | 89 ------------------------------------- src/Include/fg_stl_config.h | 1 - 3 files changed, 92 deletions(-) delete mode 100644 src/Include/auto_ptr.hxx delete mode 100644 src/Include/fg_stl_config.h diff --git a/src/Include/Makefile.am b/src/Include/Makefile.am index 6764b99aa..de7ff0ce0 100644 --- a/src/Include/Makefile.am +++ b/src/Include/Makefile.am @@ -1,8 +1,6 @@ EXTRA_DIST = \ - auto_ptr.hxx \ config.h.in \ config.h-msvc6 \ cmdargs.h \ fg_typedefs.h \ - fg_stl_config.h \ general.hxx diff --git a/src/Include/auto_ptr.hxx b/src/Include/auto_ptr.hxx deleted file mode 100644 index e4c07790f..000000000 --- a/src/Include/auto_ptr.hxx +++ /dev/null @@ -1,89 +0,0 @@ -/************************************************************************** - * auto_ptr.hxx -- A simple auto_ptr definition. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $Id$ - **************************************************************************/ - -#ifndef _AUTO_PTR_HXX -#define _AUTO_PTR_HXX - -#include "fg_stl_config.h" - -//----------------------------------------------------------------------------- -// -// auto_ptr is initialised with a pointer obtained via new and deletes that -// object when it itself is destroyed (such as when leaving block scope). -// auto_ptr can be used in any way that a normal pointer can be. -// -// This class is only required when the STL doesn't supply one. -// -template class auto_ptr { -private: - X* ptr; - mutable bool owns; - -public: - typedef X element_type; - - explicit auto_ptr(X* p = 0) : ptr(p), owns(p) {} - - auto_ptr(const auto_ptr& a) : ptr(a.ptr), owns(a.owns) { - a.owns = 0; - } - -#ifdef _SG_MEMBER_TEMPLATES - template auto_ptr(const auto_ptr& a) - : ptr(a.ptr), owns(a.owns) { - a.owns = 0; - } -#endif - - auto_ptr& operator = (const auto_ptr& a) { - if (&a != this) { - if (owns) - delete ptr; - owns = a.owns; - ptr = a.ptr; - a.owns = 0; - } - } - -#ifdef _SG_MEMBER_TEMPLATES - template auto_ptr& operator = (const auto_ptr& a) { - if (&a != this) { - if (owns) - delete ptr; - owns = a.owns; - ptr = a.ptr; - a.owns = 0; - } - } -#endif - - ~auto_ptr() { - if (owns) - delete ptr; - } - - X& operator*() const { return *ptr; } - X* operator->() const { return ptr; } - X* get() const { return ptr; } - X* release() const { owns = false; return ptr; } -}; - -#endif /* _AUTO_PTR_HXX */ - diff --git a/src/Include/fg_stl_config.h b/src/Include/fg_stl_config.h deleted file mode 100644 index 100160e69..000000000 --- a/src/Include/fg_stl_config.h +++ /dev/null @@ -1 +0,0 @@ -#include -- 2.39.5