Stxxl  1.4.0
include/stxxl/bits/compat/shared_ptr.h
Go to the documentation of this file.
00001 /***************************************************************************
00002  *  include/stxxl/bits/compat/shared_ptr.h
00003  *
00004  *  compatibility interface to shared_ptr (C++0x, TR1 or boost)
00005  *
00006  *  Part of the STXXL. See http://stxxl.sourceforge.net
00007  *
00008  *  Copyright (C) 2011 Andreas Beckmann <beckmann@cs.uni-frankfurt.de>
00009  *
00010  *  Distributed under the Boost Software License, Version 1.0.
00011  *  (See accompanying file LICENSE_1_0.txt or copy at
00012  *  http://www.boost.org/LICENSE_1_0.txt)
00013  **************************************************************************/
00014 
00015 #ifndef STXXL_HEADER__COMPAT__SHARED_PTR_H_
00016 #define STXXL_HEADER__COMPAT__SHARED_PTR_H_
00017 
00018 
00019 #include <memory>
00020 #if defined(__GNUG__) && !defined(__GXX_EXPERIMENTAL_CXX0X__) \
00021     && ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40200) \
00022     && (!defined(__ICC) || (__ICC >= 1100))
00023 #include <tr1/memory>
00024 #endif
00025 #if defined(STXXL_BOOST_CONFIG)
00026 #include <boost/shared_ptr.hpp>
00027 #include <boost/make_shared.hpp>
00028 #endif
00029 
00030 #include <stxxl/bits/namespace.h>
00031 
00032 
00033 __STXXL_BEGIN_NAMESPACE
00034 
00035 #ifndef STXXL_HAVE_SHARED_PTR
00036     #define STXXL_HAVE_SHARED_PTR 1
00037 #endif
00038 
00039 #ifndef STXXL_HAVE_MAKE_SHARED
00040     #define STXXL_HAVE_MAKE_SHARED 1
00041 #endif
00042 
00043 namespace compat
00044 {
00045 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
00046     using std::shared_ptr;
00047     using std::make_shared;
00048     using std::allocate_shared;
00049 #elif defined(STXXL_BOOST_CONFIG)
00050     using boost::shared_ptr;
00051     using boost::make_shared;
00052     using boost::allocate_shared;
00053 #elif defined(__GNUG__) && ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40200) \
00054     && (!defined(__ICC) || (__ICC >= 1100))
00055     using std::tr1::shared_ptr;
00056     #undef STXXL_HAVE_MAKE_SHARED
00057     #define STXXL_HAVE_MAKE_SHARED 0
00058 #else
00059     // no shared_ptr implementation available
00060     #undef STXXL_HAVE_SHARED_PTR
00061     #define STXXL_HAVE_SHARED_PTR 0
00062     #undef STXXL_HAVE_MAKE_SHARED
00063     #define STXXL_HAVE_MAKE_SHARED 0
00064 #endif
00065 }  // namespace compat
00066 
00067 __STXXL_END_NAMESPACE
00068 
00069 #endif // !STXXL_HEADER__COMPAT__SHARED_PTR_H_
00070 // vim: et:ts=4:sw=4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines