diff --git a/src/include/stir/unique_ptr.h b/src/include/stir/unique_ptr.h index a4d84b86a6..dafdca7ae8 100644 --- a/src/include/stir/unique_ptr.h +++ b/src/include/stir/unique_ptr.h @@ -26,55 +26,9 @@ // include this as stir/common.h has to be included by any stir .h file #include "stir/common.h" #include -#if !defined(STIR_NO_UNIQUE_PTR) // simply use std::unique_ptr namespace stir { using std::unique_ptr; } -#else -// we need to replace it with something else - -// KT attempted to use boost::movelib::unique_ptr, which is claimed to be compatible with -// std::unique_ptr but even for Cxx03 compilers. However, end 2016 this still generated errors on OSX Sierra -// with CLang (it could not return a unique_ptr). -// So, this is attempt is now disabled. -#if 0 -#include -#if (BOOST_VERSION >= 105700) -// Boost is recent enough to have a drop-in replacement -#include -namespace stir { - using boost::movelib::unique_ptr; -} -#endif -#endif - -// desperate measures. We will use a #define to auto_ptr. -// Caveat: -// This trick is likely to break on OSX as it will generate conflicts between -// this define and Apple's non-C++-11 compliant unique_ptr. -// (Reason: BOOST_NO_CXX11_SMART_PTR is set, so we define unique_ptr here, but some include files will still -// have unique_ptr with 2 template arguments, while auto_ptr needs only one). -// Best solution: tell your compiler to use C++-11 or later (normally this means adding -std=c++11) - -// We first include a bunch of system files which use std::unique_ptr such that we don't have a conflict. -// You might have to add a few more... -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define unique_ptr auto_ptr -using std::auto_ptr; -#endif #endif