14#ifndef PLASK__MEMORY_H
15#define PLASK__MEMORY_H
22#include <plask/config.hpp>
24#ifdef PLASK_SHARED_PTR_STD
28 using std::shared_ptr;
29 using std::make_shared;
30 using std::dynamic_pointer_cast;
31 using std::static_pointer_cast;
32 using std::const_pointer_cast;
34 using std::enable_shared_from_this;
40#define BOOST_BIND_GLOBAL_PLACEHOLDERS
42#include <boost/shared_ptr.hpp>
43#include <boost/make_shared.hpp>
44#include <boost/weak_ptr.hpp>
45#include <boost/enable_shared_from_this.hpp>
47 using boost::shared_ptr;
48 using boost::make_shared;
49 using boost::dynamic_pointer_cast;
50 using boost::static_pointer_cast;
51 using boost::const_pointer_cast;
52 using boost::weak_ptr;
53 using boost::enable_shared_from_this;
173inline shared_ptr<T>
getUnique(
const shared_ptr<T>& ptr) {
174 return ptr.unique() ? ptr :
new T(*ptr);
185 return ptr.unique() ? ptr :
new T(*ptr);