Ticket #8115: signals2-cxx11-smart-ptr.patch
File signals2-cxx11-smart-ptr.patch, 1.9 KB (added by , 10 years ago) |
---|
-
boost/signals2/detail/foreign_ptr.hpp
18 18 #include <boost/smart_ptr/bad_weak_ptr.hpp> 19 19 #include <boost/utility/swap.hpp> 20 20 21 //FIXME: this is a hack to deal with the fact BOOST_NO_CXX_SMART_PTR doesn't 22 // exist yet in boost.config. It will fail on a library which implements 23 // C++11 std::tuple but not std::shared_ptr and std::weak_ptr. 24 #ifdef BOOST_NO_CXX11_HDR_TUPLE 25 #define BOOST_SIGNALS2_NO_CXX11_SMART_PTR 26 #endif 27 28 #ifndef BOOST_SIGNALS2_NO_CXX11_SMART_PTR 21 #ifndef BOOST_NO_CXX11_SMART_PTR 29 22 #include <memory> 30 23 #endif 31 24 … … 42 35 { 43 36 typedef boost::shared_ptr<T> shared_type; 44 37 }; 45 #ifndef BOOST_ SIGNALS2_NO_CXX11_SMART_PTR38 #ifndef BOOST_NO_CXX11_SMART_PTR 46 39 template<typename T> struct weak_ptr_traits<std::weak_ptr<T> > 47 40 { 48 41 typedef std::shared_ptr<T> shared_type; … … 56 49 { 57 50 typedef boost::weak_ptr<T> weak_type; 58 51 }; 59 #ifndef BOOST_ SIGNALS2_NO_CXX11_SMART_PTR52 #ifndef BOOST_NO_CXX11_SMART_PTR 60 53 template<typename T> struct shared_ptr_traits<std::shared_ptr<T> > 61 54 { 62 55 typedef std::weak_ptr<T> weak_type; -
libs/signals2/test/track_test.cpp
110 110 } 111 111 BOOST_CHECK(s1(2) == 0); 112 112 113 // there isn't a boost config macro that detects the existance of std::shared_ptr or std::weak_ptr, 114 // so we rely on BOOST_NO_CXX11_VARIADIC_TEMPLATES as a hack 115 #ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES 113 #ifndef BOOST_NO_CXX11_SMART_PTR 116 114 // Test tracking through std::shared_ptr/weak_ptr 117 115 BOOST_CHECK(s1(5) == 0); 118 116 {