From 6acc33aabc701de1e2da5363cce38ec0d6deb741 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@dune-project.org> Date: Tue, 13 Oct 2009 16:02:46 +0000 Subject: [PATCH] if an implementation of shared_ptr has been found in either std, tr1, or boost, then use that one. If not fall back on our own [[Imported from SVN: r5642]] --- common/shared_ptr.hh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/common/shared_ptr.hh b/common/shared_ptr.hh index b0e6fc5a8..ec83e9923 100644 --- a/common/shared_ptr.hh +++ b/common/shared_ptr.hh @@ -5,6 +5,17 @@ #ifndef DUNE_SHARED_PTR_HH #define DUNE_SHARED_PTR_HH + +#if defined HAVE_MEMORY +# include <memory> +#endif +#if defined HAVE_TR1_MEMORY +# include <tr1/memory> +#endif +#if defined HAVE_BOOST_SHARED_PTR_HPP +# include <boost/shared_ptr.hpp> +#endif + /** * @file * @brief This file implements the class shared_ptr (a reference counting @@ -13,6 +24,11 @@ */ namespace Dune { + // A shared_ptr implementation has been found if SHARED_PTR_NAMESPACE is set at all +#ifdef SHARED_PTR_NAMESPACE + using SHARED_PTR_NAMESPACE :: shared_ptr; +#else + /** @addtogroup Common * * @{ @@ -175,5 +191,7 @@ namespace Dune rep_=0; } /** @} */ +#endif // #ifdef SHARED_PTR_NAMESPACE + } #endif -- GitLab