]> git.mxchange.org Git - flightgear.git/commitdiff
- auto_ptr.hxx: not used anywhere; functionally replaced by
authormfranz <mfranz>
Wed, 21 Jun 2006 09:36:15 +0000 (09:36 +0000)
committermfranz <mfranz>
Wed, 21 Jun 2006 09:36:15 +0000 (09:36 +0000)
                   simgear/structure/SGSharedPtr.hxx
- fg_stl_config.h: only used by obsolete auto_ptr.hxx

src/Include/Makefile.am
src/Include/auto_ptr.hxx [deleted file]
src/Include/fg_stl_config.h [deleted file]

index 6764b99aa401a311178ca655d8316771e15685db..de7ff0ce0dc155507407d9e0db4c185d0757bba6 100644 (file)
@@ -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 (file)
index e4c0779..0000000
+++ /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 X> 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 <class T> auto_ptr(const auto_ptr<T>& 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 <class T> auto_ptr& operator = (const auto_ptr<T>& 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 (file)
index 100160e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <Include/compiler.h>