|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83102 - in branches/release: boost/signals2 boost/signals2/detail libs/signals2 libs/signals2/doc libs/signals2/test
From: fmhess_at_[hidden]
Date: 2013-02-23 12:04:03
Author: fmhess
Date: 2013-02-23 12:04:02 EST (Sat, 23 Feb 2013)
New Revision: 83102
URL: http://svn.boost.org/trac/boost/changeset/83102
Log:
Merged from trunk. Closes #8102. Closes #8103. Closes #8115.
Properties modified:
branches/release/boost/signals2/ (props changed)
branches/release/libs/signals2/ (props changed)
branches/release/libs/signals2/doc/ (props changed)
Text files modified:
branches/release/boost/signals2/detail/foreign_ptr.hpp | 13 +++----------
branches/release/boost/signals2/detail/variadic_slot_invoker.hpp | 17 ++++++++++-------
branches/release/libs/signals2/test/Jamfile.v2 | 4 ++--
branches/release/libs/signals2/test/track_test.cpp | 4 +---
4 files changed, 16 insertions(+), 22 deletions(-)
Modified: branches/release/boost/signals2/detail/foreign_ptr.hpp
==============================================================================
--- branches/release/boost/signals2/detail/foreign_ptr.hpp (original)
+++ branches/release/boost/signals2/detail/foreign_ptr.hpp 2013-02-23 12:04:02 EST (Sat, 23 Feb 2013)
@@ -18,14 +18,7 @@
#include <boost/smart_ptr/bad_weak_ptr.hpp>
#include <boost/utility/swap.hpp>
-//FIXME: this is a hack to deal with the fact BOOST_NO_CXX_SMART_PTR doesn't
-// exist yet in boost.config. It will fail on a library which implements
-// C++11 std::tuple but not std::shared_ptr and std::weak_ptr.
-#ifdef BOOST_NO_CXX11_HDR_TUPLE
-#define BOOST_SIGNALS2_NO_CXX11_SMART_PTR
-#endif
-
-#ifndef BOOST_SIGNALS2_NO_CXX11_SMART_PTR
+#ifndef BOOST_NO_CXX11_SMART_PTR
#include <memory>
#endif
@@ -42,7 +35,7 @@
{
typedef boost::shared_ptr<T> shared_type;
};
-#ifndef BOOST_SIGNALS2_NO_CXX11_SMART_PTR
+#ifndef BOOST_NO_CXX11_SMART_PTR
template<typename T> struct weak_ptr_traits<std::weak_ptr<T> >
{
typedef std::shared_ptr<T> shared_type;
@@ -56,7 +49,7 @@
{
typedef boost::weak_ptr<T> weak_type;
};
-#ifndef BOOST_SIGNALS2_NO_CXX11_SMART_PTR
+#ifndef BOOST_NO_CXX11_SMART_PTR
template<typename T> struct shared_ptr_traits<std::shared_ptr<T> >
{
typedef std::weak_ptr<T> weak_type;
Modified: branches/release/boost/signals2/detail/variadic_slot_invoker.hpp
==============================================================================
--- branches/release/boost/signals2/detail/variadic_slot_invoker.hpp (original)
+++ branches/release/boost/signals2/detail/variadic_slot_invoker.hpp 2013-02-23 12:04:02 EST (Sat, 23 Feb 2013)
@@ -15,6 +15,7 @@
#ifndef BOOST_SIGNALS2_DETAIL_VARIADIC_SLOT_INVOKER_HPP
#define BOOST_SIGNALS2_DETAIL_VARIADIC_SLOT_INVOKER_HPP
+#include <boost/mpl/size_t.hpp>
#include <boost/signals2/detail/variadic_arg_type.hpp>
// if compiler has std::tuple use it instead of boost::tuple
@@ -22,9 +23,11 @@
#ifdef BOOST_NO_CXX11_HDR_TUPLE
#include <boost/tuple/tuple.hpp>
#define BOOST_SIGNALS2_TUPLE boost::tuple
+#define BOOST_SIGNALS2_GET boost::get
#else
#include <tuple>
#define BOOST_SIGNALS2_TUPLE std::tuple
+#define BOOST_SIGNALS2_GET std::get
#endif
namespace boost
@@ -70,10 +73,10 @@
public:
typedef R result_type;
- template<typename Func, typename ... Args>
- R operator()(Func &func, BOOST_SIGNALS2_TUPLE<Args...> args) const
+ template<typename Func, typename ... Args, std::size_t N>
+ R operator()(Func &func, BOOST_SIGNALS2_TUPLE<Args...> args, mpl::size_t<N>) const
{
- typedef typename make_unsigned_meta_array<sizeof...(Args)>::type indices_type;
+ typedef typename make_unsigned_meta_array<N>::type indices_type;
typename Func::result_type *resolver = 0;
return m_invoke(resolver, func, indices_type(), args);
}
@@ -81,12 +84,12 @@
template<typename T, typename Func, unsigned ... indices, typename ... Args>
R m_invoke(T *, Func &func, unsigned_meta_array<indices...>, BOOST_SIGNALS2_TUPLE<Args...> args) const
{
- return func(std::get<indices>(args)...);
+ return func(BOOST_SIGNALS2_GET<indices>(args)...);
}
template<typename Func, unsigned ... indices, typename ... Args>
R m_invoke(void *, Func &func, unsigned_meta_array<indices...>, BOOST_SIGNALS2_TUPLE<Args...> args) const
{
- func(std::get<indices>(args)...);
+ func(BOOST_SIGNALS2_GET<indices>(args)...);
return R();
}
};
@@ -111,13 +114,13 @@
result_type m_invoke(const ConnectionBodyType &connectionBody,
const void_type *) const
{
- return call_with_tuple_args<result_type>()(connectionBody->slot.slot_function(), _args);
+ return call_with_tuple_args<result_type>()(connectionBody->slot.slot_function(), _args, mpl::size_t<sizeof...(Args)>());
return void_type();
}
template<typename ConnectionBodyType>
result_type m_invoke(const ConnectionBodyType &connectionBody, ...) const
{
- return call_with_tuple_args<result_type>()(connectionBody->slot.slot_function(), _args);
+ return call_with_tuple_args<result_type>()(connectionBody->slot.slot_function(), _args, mpl::size_t<sizeof...(Args)>());
}
BOOST_SIGNALS2_TUPLE<Args& ...> _args;
};
Modified: branches/release/libs/signals2/test/Jamfile.v2
==============================================================================
--- branches/release/libs/signals2/test/Jamfile.v2 (original)
+++ branches/release/libs/signals2/test/Jamfile.v2 2013-02-23 12:04:02 EST (Sat, 23 Feb 2013)
@@ -16,14 +16,14 @@
: source-location .
: requirements
<hardcode-dll-paths>true
- <library>../../test/build//boost_test_exec_monitor
+ <library>/boost/test//boost_unit_test_framework
<link>static
;
rule thread-run ( sources )
{
return
- [ run $(sources) : : : <library>../../thread/build//boost_thread/
+ [ run $(sources) : : : <library>/boost/thread//boost_thread/
<threading>multi ]
;
}
Modified: branches/release/libs/signals2/test/track_test.cpp
==============================================================================
--- branches/release/libs/signals2/test/track_test.cpp (original)
+++ branches/release/libs/signals2/test/track_test.cpp 2013-02-23 12:04:02 EST (Sat, 23 Feb 2013)
@@ -110,9 +110,7 @@
}
BOOST_CHECK(s1(2) == 0);
-// there isn't a boost config macro that detects the existance of std::shared_ptr or std::weak_ptr,
-// so we rely on BOOST_NO_CXX11_VARIADIC_TEMPLATES as a hack
-#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#ifndef BOOST_NO_CXX11_SMART_PTR
// Test tracking through std::shared_ptr/weak_ptr
BOOST_CHECK(s1(5) == 0);
{
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk