Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53355 - in trunk: boost/signals2 boost/signals2/detail libs/signals2/test
From: fmhess_at_[hidden]
Date: 2009-05-28 14:49:30


Author: fmhess
Date: 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
New Revision: 53355
URL: http://svn.boost.org/trac/boost/changeset/53355

Log:
Added variadic signal/slot implementations used when
BOOST_NO_VARIADIC_TEMPLATES is not defined. The
signal0, signal1, etc classes are not available when using
the variadic implementations, I plan to mark them as
deprecated. Also the arg1_type, arg2_type member typedefs
are not available and are replaced with a "arg" member
template class. Documentation updates to follow.

Added:
   trunk/boost/signals2/detail/preprocessed_arg_type.hpp (contents, props changed)
   trunk/boost/signals2/detail/preprocessed_arg_type_template.hpp (contents, props changed)
   trunk/boost/signals2/detail/replace_slot_function.hpp (contents, props changed)
   trunk/boost/signals2/detail/variadic_arg_type.hpp (contents, props changed)
   trunk/boost/signals2/detail/variadic_slot_invoker.hpp (contents, props changed)
   trunk/boost/signals2/preprocessed_signal.hpp (contents, props changed)
      - copied, changed from r53280, /trunk/boost/signals2/signal.hpp
   trunk/boost/signals2/preprocessed_slot.hpp (contents, props changed)
      - copied, changed from r53280, /trunk/boost/signals2/slot.hpp
   trunk/boost/signals2/variadic_signal.hpp (contents, props changed)
   trunk/boost/signals2/variadic_slot.hpp (contents, props changed)
Removed:
   trunk/boost/signals2/signal.hpp
   trunk/boost/signals2/slot.hpp
Text files modified:
   trunk/boost/signals2/detail/signal_template.hpp | 257 ++++++++++++++++++++-------------------
   trunk/boost/signals2/detail/signals_common.hpp | 30 ++++
   trunk/boost/signals2/detail/signals_common_macros.hpp | 138 ++++++++++++++++++++
   trunk/boost/signals2/detail/slot_template.hpp | 45 +++++-
   trunk/boost/signals2/preprocessed_signal.hpp | 48 ------
   trunk/boost/signals2/preprocessed_slot.hpp | 79 +++--------
   trunk/libs/signals2/test/connection_test.cpp | 2
   trunk/libs/signals2/test/dead_slot_test.cpp | 2
   trunk/libs/signals2/test/deletion_test.cpp | 10
   trunk/libs/signals2/test/ordering_test.cpp | 2
   trunk/libs/signals2/test/regression_test.cpp | 4
   trunk/libs/signals2/test/shared_connection_block_test.cpp | 2
   trunk/libs/signals2/test/signal_n_test.cpp | 13 +
   trunk/libs/signals2/test/signal_test.cpp | 22 +++
   trunk/libs/signals2/test/slot_compile_test.cpp | 1
   trunk/libs/signals2/test/track_test.cpp | 2
   trunk/libs/signals2/test/trackable_test.cpp | 4
   17 files changed, 405 insertions(+), 256 deletions(-)

Added: trunk/boost/signals2/detail/preprocessed_arg_type.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/signals2/detail/preprocessed_arg_type.hpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -0,0 +1,22 @@
+// Boost.Signals2 library
+
+// Copyright Frank Mori Hess 2007-2009.
+// Copyright Timmo Stange 2007.
+// Copyright Douglas Gregor 2001-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_PREPROCESSED_ARG_TYPE_HPP
+#define BOOST_SIGNALS2_PREPROCESSED_ARG_TYPE_HPP
+
+#include <boost/preprocessor/repetition.hpp>
+#include <boost/signals2/detail/signals_common_macros.hpp>
+
+#define BOOST_PP_ITERATION_LIMITS (0, BOOST_PP_INC(BOOST_SIGNALS2_MAX_ARGS))
+#define BOOST_PP_FILENAME_1 <boost/signals2/detail/preprocessed_arg_type_template.hpp>
+#include BOOST_PP_ITERATE()
+
+#endif // BOOST_SIGNALS2_PREPROCESSED_ARG_TYPE_HPP

Added: trunk/boost/signals2/detail/preprocessed_arg_type_template.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/signals2/detail/preprocessed_arg_type_template.hpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -0,0 +1,39 @@
+// Copyright Frank Mori Hess 2009
+//
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+// This file is included iteratively, and should not be protected from multiple inclusion
+
+#define BOOST_SIGNALS2_NUM_ARGS BOOST_PP_ITERATION()
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ template<unsigned n BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_PREPROCESSED_ARG_N_TYPE_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
+
+// template<typename T1, typename T2, ... , typename TN> class preprocessed_arg_typeN<n, T1, T2, ..., TN>{...} ...
+#define BOOST_SIGNALS2_PREPROCESSED_ARG_TYPE_CLASS_TEMPLATE_SPECIALIZATION(z, n, data) \
+ template<BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)> \
+ class BOOST_SIGNALS2_PREPROCESSED_ARG_N_TYPE_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)<n, \
+ BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS)> \
+ { \
+ public: \
+ typedef BOOST_PP_CAT(T, BOOST_PP_INC(n)) type; \
+ };
+ BOOST_PP_REPEAT(BOOST_SIGNALS2_NUM_ARGS, BOOST_SIGNALS2_PREPROCESSED_ARG_TYPE_CLASS_TEMPLATE_SPECIALIZATION, ~)
+
+ } // namespace detail
+ } // namespace signals2
+} // namespace boost
+
+#undef BOOST_SIGNALS2_NUM_ARGS

Added: trunk/boost/signals2/detail/replace_slot_function.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/signals2/detail/replace_slot_function.hpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -0,0 +1,37 @@
+// Copyright Frank Mori Hess 2007-2009
+//
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_DETAIL_REPLACE_SLOT_FUNCTION_HPP
+#define BOOST_SIGNALS2_DETAIL_REPLACE_SLOT_FUNCTION_HPP
+
+#include <boost/signals2/slot_base.hpp>
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ template<typename ResultSlot, typename SlotIn, typename SlotFunction>
+ ResultSlot replace_slot_function(const SlotIn &slot_in, const SlotFunction &fun)
+ {
+ ResultSlot slot(fun);
+ slot_base::tracked_container_type tracked_objects = slot_in.tracked_objects();
+ slot_base::tracked_container_type::const_iterator it;
+ for(it = tracked_objects.begin(); it != tracked_objects.end(); ++it)
+ {
+ slot.track(*it);
+ }
+ return slot;
+ }
+ } // namespace detail
+ } // namespace signals2
+} // namespace boost
+
+#endif // BOOST_SIGNALS2_DETAIL_REPLACE_SLOT_FUNCTION_HPP

Modified: trunk/boost/signals2/detail/signal_template.hpp
==============================================================================
--- trunk/boost/signals2/detail/signal_template.hpp (original)
+++ trunk/boost/signals2/detail/signal_template.hpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -13,30 +13,12 @@
 
 // This file is included iteratively, and should not be protected from multiple inclusion
 
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
 #define BOOST_SIGNALS2_NUM_ARGS BOOST_PP_ITERATION()
+#else
+#define BOOST_SIGNALS2_NUM_ARGS 1
+#endif
 
-#define BOOST_SIGNALS2_SIGNAL_CLASS_NAME BOOST_PP_CAT(signal, BOOST_SIGNALS2_NUM_ARGS)
-#define BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME BOOST_PP_CAT(weak_, BOOST_SIGNALS2_SIGNAL_CLASS_NAME)
-#define BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME BOOST_PP_CAT(BOOST_SIGNALS2_SIGNAL_CLASS_NAME, _impl)
-
-// typename R, typename T1, typename T2, ..., typename TN, typename Combiner = optional_last_value<R>, ...
-#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL \
- BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS), \
- typename Combiner = optional_last_value<R>, \
- typename Group = int, \
- typename GroupCompare = std::less<Group>, \
- typename SlotFunction = BOOST_SIGNALS2_FUNCTION_N_DECL(BOOST_SIGNALS2_NUM_ARGS), \
- typename ExtendedSlotFunction = BOOST_SIGNALS2_EXT_FUNCTION_N_DECL(BOOST_SIGNALS2_NUM_ARGS), \
- typename Mutex = signals2::mutex
-// typename R, typename T1, typename T2, ..., typename TN, typename Combiner, ...
-#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL \
- BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS), \
- typename Combiner, \
- typename Group, \
- typename GroupCompare, \
- typename SlotFunction, \
- typename ExtendedSlotFunction, \
- typename Mutex
 // R, T1, T2, ..., TN, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex
 #define BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION \
   BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS), \
@@ -48,28 +30,16 @@
   {
     namespace detail
     {
-// typename T1, typename T2, ..., typename TN
-#define BOOST_SIGNALS2_MISC_TEMPLATE_DECL \
- BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(BOOST_SIGNALS2_NUM_ARGS), typename T)
-// Tn & argn
-#define BOOST_SIGNALS2_FULL_REF_ARG(z, n, data) \
- BOOST_PP_CAT(T, BOOST_PP_INC(n)) & BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~)
-// T1 & arg1, T2 & arg2, ..., Tn & argn
-#define BOOST_SIGNALS2_FULL_REF_ARGS(arity) \
- BOOST_PP_ENUM(arity, BOOST_SIGNALS2_FULL_REF_ARG, ~)
-
 // wrapper around an signalN::extended_slot_function which binds the
 // connection argument so it looks like a normal
 // signalN::slot_function
 
-// bound_extended_slot_functionN
-#define BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N BOOST_PP_CAT(bound_extended_slot_function, BOOST_SIGNALS2_NUM_ARGS)
       template<typename ExtendedSlotFunction>
- class BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N
+ class BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(BOOST_SIGNALS2_NUM_ARGS)
       {
       public:
         typedef typename result_type_wrapper<typename ExtendedSlotFunction::result_type>::type result_type;
- BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(const ExtendedSlotFunction &fun):
+ BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(BOOST_SIGNALS2_NUM_ARGS)(const ExtendedSlotFunction &fun):
           _fun(fun), _connection(new connection)
         {}
         void set_connection(const connection &conn)
@@ -78,23 +48,23 @@
         }
 
 #if BOOST_SIGNALS2_NUM_ARGS > 0
- template<BOOST_SIGNALS2_MISC_TEMPLATE_DECL>
+ template<BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
 #endif // BOOST_SIGNALS2_NUM_ARGS > 0
           result_type operator()(BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS))
         {
           typename ExtendedSlotFunction::result_type *resolver = 0;
- return m_invoke(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS)
- BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) resolver);
+ return m_invoke(resolver BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
         }
         // const overload
 #if BOOST_SIGNALS2_NUM_ARGS > 0
- template<BOOST_SIGNALS2_MISC_TEMPLATE_DECL>
+ template<BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
 #endif // BOOST_SIGNALS2_NUM_ARGS > 0
           result_type operator()(BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const
         {
           typename ExtendedSlotFunction::result_type *resolver = 0;
- return m_invoke(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS)
- BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) resolver);
+ return m_invoke(resolver BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
         }
         template<typename T>
           bool operator==(const T &other) const
@@ -102,40 +72,42 @@
           return _fun == other;
         }
       private:
- BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N()
+ BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(BOOST_SIGNALS2_NUM_ARGS)()
         {}
-#if BOOST_SIGNALS2_NUM_ARGS > 0
- template<BOOST_SIGNALS2_MISC_TEMPLATE_DECL>
-#endif // BOOST_SIGNALS2_NUM_ARGS > 0
- result_type m_invoke(BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS) BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) ...)
+ template<typename T BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ result_type m_invoke(T* BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS))
         {
- return _fun(*_connection BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ return _fun(*_connection BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
             BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
         }
 #if BOOST_SIGNALS2_NUM_ARGS > 0
- template<BOOST_SIGNALS2_MISC_TEMPLATE_DECL>
+ template<BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
 #endif // BOOST_SIGNALS2_NUM_ARGS > 0
- result_type m_invoke(BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS) BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) const void*)
+ result_type m_invoke(void* BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS))
         {
- _fun(*_connection BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ _fun(*_connection BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
             BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
           return result_type();
         }
         // const overloads
-#if BOOST_SIGNALS2_NUM_ARGS > 0
- template<BOOST_SIGNALS2_MISC_TEMPLATE_DECL>
-#endif // BOOST_SIGNALS2_NUM_ARGS > 0
- result_type m_invoke(BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS) BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) ...) const
+ template<typename T BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ result_type m_invoke(T* BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const
         {
- return _fun(*_connection BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ return _fun(*_connection BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
             BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
         }
 #if BOOST_SIGNALS2_NUM_ARGS > 0
- template<BOOST_SIGNALS2_MISC_TEMPLATE_DECL>
+ template<BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
 #endif // BOOST_SIGNALS2_NUM_ARGS > 0
- result_type m_invoke(BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS) BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) const void*) const
+ result_type m_invoke(void* BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const
         {
- _fun(*_connection BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ _fun(*_connection BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
             BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
           return result_type();
         }
@@ -144,32 +116,34 @@
         boost::shared_ptr<connection> _connection;
       };
 
-#undef BOOST_SIGNALS2_MISC_TEMPLATE_DECL
-#undef BOOST_SIGNALS2_FULL_REF_ARG
-#undef BOOST_SIGNALS2_FULL_REF_ARGS
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
 
- template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL>
- class BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS) BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION
       {
       public:
         typedef SlotFunction slot_function_type;
         // typedef slotN<Signature, SlotFunction> slot_type;
- typedef BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)<BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS),
+ typedef BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS),
           slot_function_type> slot_type;
         typedef ExtendedSlotFunction extended_slot_function_type;
- // typedef slotN<R, const connection &, T1, T2, ..., TN, extended_slot_function_type> extended_slot_type;
- typedef BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_PP_INC(BOOST_SIGNALS2_NUM_ARGS))<
- BOOST_SIGNALS2_EXT_SLOT_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS),
- extended_slot_function_type> extended_slot_type;
+ // typedef slotN+1<R, const connection &, T1, T2, ..., TN, extended_slot_function_type> extended_slot_type;
+ typedef BOOST_SIGNALS2_EXTENDED_SLOT_TYPE(BOOST_SIGNALS2_NUM_ARGS) extended_slot_type;
+ typedef typename nonvoid<typename slot_function_type::result_type>::type slot_result_type;
       private:
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
         class slot_invoker;
+#else // BOOST_NO_VARIADIC_TEMPLATES
+ typedef variadic_slot_invoker<slot_result_type, Args...> slot_invoker;
+#endif // BOOST_NO_VARIADIC_TEMPLATES
         typedef typename group_key<Group>::type group_key_type;
         typedef shared_ptr<connection_body<group_key_type, slot_type, Mutex> > connection_body_type;
         typedef grouped_list<Group, GroupCompare, connection_body_type> connection_list_type;
- typedef BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N<extended_slot_function_type>
+ typedef BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(BOOST_SIGNALS2_NUM_ARGS)<extended_slot_function_type>
           bound_extended_slot_function_type;
       public:
- typedef typename nonvoid<typename slot_function_type::result_type>::type slot_result_type;
         typedef Combiner combiner_type;
         typedef typename combiner_type::result_type result_type;
         typedef Group group_type;
@@ -177,7 +151,7 @@
         typedef typename detail::slot_call_iterator_t<slot_invoker,
           typename connection_list_type::iterator, connection_body<group_key_type, slot_type, Mutex> > slot_call_iterator;
 
- BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(const combiner_type &combiner,
+ BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const combiner_type &combiner,
           const group_compare_type &group_compare):
           _shared_state(new invocation_state(connection_list_type(group_compare), combiner)),
           _garbage_collector_it(_shared_state->connection_bodies().end())
@@ -261,8 +235,7 @@
             during invocation. */
             local_state = _shared_state;
           }
- slot_invoker invoker BOOST_PP_IF(BOOST_SIGNALS2_NUM_ARGS, \
- (BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS)), );
+ slot_invoker invoker = slot_invoker(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
           slot_call_iterator_cache<slot_result_type, slot_invoker> cache(invoker);
           return local_state->combiner()(
             slot_call_iterator(local_state->connection_bodies().begin(), local_state->connection_bodies().end(), cache),
@@ -282,8 +255,7 @@
             during invocation. */
             local_state = _shared_state;
           }
- slot_invoker invoker BOOST_PP_IF(BOOST_SIGNALS2_NUM_ARGS, \
- (BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS)), );
+ slot_invoker invoker = slot_invoker(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
           slot_call_iterator_cache<slot_result_type, slot_invoker> cache(invoker);
           return local_state->combiner()(
             slot_call_iterator(local_state->connection_bodies().begin(), local_state->connection_bodies().end(), cache),
@@ -331,12 +303,12 @@
         typedef Mutex mutex_type;
 
         // slot_invoker is passed to slot_call_iterator_t to run slots
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
         class slot_invoker
         {
         public:
           typedef slot_result_type result_type;
-
- slot_invoker(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS)) BOOST_PP_IF(BOOST_SIGNALS2_NUM_ARGS, :, )
+ slot_invoker(BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS)) BOOST_PP_IF(BOOST_SIGNALS2_NUM_ARGS, :, )
 // argn ( argn ) ,
 #define BOOST_SIGNALS2_MISC_STATEMENT(z, n, data) \
   BOOST_PP_CAT(arg, n) ( BOOST_PP_CAT(arg, n) )
@@ -350,12 +322,12 @@
             return m_invoke(connectionBody,
               resolver);
           }
-// Tn argn;
+ private:
+// Tn & argn;
 #define BOOST_SIGNALS2_MISC_STATEMENT(z, n, Signature) \
- BOOST_PP_CAT(T, BOOST_PP_INC(n)) BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~);
+ BOOST_PP_CAT(T, BOOST_PP_INC(n)) & BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~);
           BOOST_PP_REPEAT(BOOST_SIGNALS2_NUM_ARGS, BOOST_SIGNALS2_MISC_STATEMENT, ~)
 #undef BOOST_SIGNALS2_MISC_STATEMENT
- private:
           result_type m_invoke(const connection_body_type &connectionBody,
             const void_type *) const
           {
@@ -367,6 +339,7 @@
             return connectionBody->slot.slot_function()(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
           }
         };
+#endif // BOOST_NO_VARIADIC_TEMPLATES
         // a struct used to optimize (minimize) the number of shared_ptrs that need to be created
         // inside operator()
         class invocation_state
@@ -530,17 +503,24 @@
         mutable mutex_type _mutex;
       };
 
- template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL>
- class BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME;
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
     }
 
- template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL>
- class BOOST_SIGNALS2_SIGNAL_CLASS_NAME: public signal_base
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
+
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION: public signal_base
     {
- typedef detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> impl_class;
+ typedef detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> impl_class;
     public:
- typedef detail::BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> weak_signal_type;
- friend class detail::BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION>;
+ typedef detail::BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> weak_signal_type;
+ friend class detail::BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION>;
 
       typedef SlotFunction slot_function_type;
       // typedef slotN<Signature, SlotFunction> slot_type;
@@ -554,6 +534,9 @@
       typedef GroupCompare group_compare_type;
       typedef typename impl_class::slot_call_iterator
         slot_call_iterator;
+
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
+
 // typedef Tn argn_type;
 #define BOOST_SIGNALS2_MISC_STATEMENT(z, n, data) \
   typedef BOOST_PP_CAT(T, BOOST_PP_INC(n)) BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(n)), _type);
@@ -565,13 +548,31 @@
       typedef arg1_type first_argument_type;
       typedef arg2_type second_argument_type;
 #endif
+
+ template<unsigned n> class arg : public
+ detail::BOOST_SIGNALS2_PREPROCESSED_ARG_N_TYPE_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <n BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS)>
+ {};
+
       BOOST_STATIC_CONSTANT(int, arity = BOOST_SIGNALS2_NUM_ARGS);
 
- BOOST_SIGNALS2_SIGNAL_CLASS_NAME(const combiner_type &combiner = combiner_type(),
+#else // BOOST_NO_VARIADIC_TEMPLATES
+
+ template<unsigned n> class arg
+ {
+ public:
+ typedef typename detail::variadic_arg_type<n, Args...>::type type;
+ };
+ BOOST_STATIC_CONSTANT(int, arity = detail::vararg_count<Args...>::value);
+
+#endif // BOOST_NO_VARIADIC_TEMPLATES
+
+ BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const combiner_type &combiner = combiner_type(),
         const group_compare_type &group_compare = group_compare_type()):
         _pimpl(new impl_class(combiner, group_compare))
       {};
- virtual ~BOOST_SIGNALS2_SIGNAL_CLASS_NAME()
+ virtual ~BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)()
       {
         disconnect_all_slots();
       }
@@ -643,56 +644,52 @@
     namespace detail
     {
       // wrapper class for storing other signals as slots with automatic lifetime tracking
- template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL>
- class BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
+
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION
       {
       public:
         typedef SlotFunction slot_function_type;
         typedef typename nonvoid<typename slot_function_type::result_type>::type slot_result_type;
- typedef typename BOOST_SIGNALS2_SIGNAL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION>::result_type
+ typedef typename BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION>::result_type
           result_type;
 
- BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(const BOOST_SIGNALS2_SIGNAL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION>
+ BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ (const BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION>
           &signal):
           _weak_pimpl(signal._pimpl)
         {}
         result_type operator ()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS))
         {
- shared_ptr<detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> >
+ shared_ptr<detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> >
             shared_pimpl(_weak_pimpl.lock());
           if(shared_pimpl == 0) boost::throw_exception(expired_slot());
           return (*shared_pimpl)(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
         }
         result_type operator ()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const
         {
- shared_ptr<detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> >
+ shared_ptr<detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> >
             shared_pimpl(_weak_pimpl.lock());
           if(shared_pimpl == 0) boost::throw_exception(expired_slot());
           return (*shared_pimpl)(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
         }
       private:
- boost::weak_ptr<detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> >
- _weak_pimpl;
- };
-
- template<unsigned arity, typename Signature, typename Combiner,
- typename Group, typename GroupCompare, typename SlotFunction,
- typename ExtendedSlotFunction, typename Mutex>
- class signalN;
- // partial template specialization
- template<typename Signature, typename Combiner, typename Group,
- typename GroupCompare, typename SlotFunction,
- typename ExtendedSlotFunction, typename Mutex>
- class signalN<BOOST_SIGNALS2_NUM_ARGS, Signature, Combiner, Group,
- GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>
- {
- public:
- typedef BOOST_SIGNALS2_SIGNAL_CLASS_NAME<
- BOOST_SIGNALS2_PORTABLE_SIGNATURE(BOOST_SIGNALS2_NUM_ARGS, Signature),
- Combiner, Group,
- GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex> type;
+ boost::weak_ptr<detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> > _weak_pimpl;
       };
 
+#ifndef BOOST_NO_VARIADIC_TEMPLATES
+ template<int arity, typename Signature>
+ class extended_signature: public variadic_extended_signature<Signature>
+ {};
+#else // BOOST_NO_VARIADIC_TEMPLATES
       template<int arity, typename Signature>
         class extended_signature;
       // partial template specialization
@@ -708,21 +705,35 @@
 // typename function_traits<Signature>::argn_type)
 #define BOOST_SIGNALS2_EXT_SIGNATURE(arity, Signature) \
   typename function_traits<Signature>::result_type ( \
- const boost::signals2::connection & BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) \
+ const boost::signals2::connection & BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) \
   BOOST_PP_ENUM(arity, BOOST_SIGNALS2_SIGNATURE_TO_ARGN_TYPE, Signature) )
         typedef function<BOOST_SIGNALS2_EXT_SIGNATURE(BOOST_SIGNALS2_NUM_ARGS, Signature)> function_type;
 #undef BOOST_SIGNALS2_EXT_SIGNATURE
       };
 
+ template<unsigned arity, typename Signature, typename Combiner,
+ typename Group, typename GroupCompare, typename SlotFunction,
+ typename ExtendedSlotFunction, typename Mutex>
+ class signalN;
+ // partial template specialization
+ template<typename Signature, typename Combiner, typename Group,
+ typename GroupCompare, typename SlotFunction,
+ typename ExtendedSlotFunction, typename Mutex>
+ class signalN<BOOST_SIGNALS2_NUM_ARGS, Signature, Combiner, Group,
+ GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>
+ {
+ public:
+ typedef BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)<
+ BOOST_SIGNALS2_PORTABLE_SIGNATURE(BOOST_SIGNALS2_NUM_ARGS, Signature),
+ Combiner, Group,
+ GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex> type;
+ };
+
+#endif // BOOST_NO_VARIADIC_TEMPLATES
+
     } // namespace detail
   } // namespace signals2
 } // namespace boost
 
 #undef BOOST_SIGNALS2_NUM_ARGS
-#undef BOOST_SIGNALS2_SIGNAL_CLASS_NAME
-#undef BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME
-#undef BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME
-#undef BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL
-#undef BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL
 #undef BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION
-#undef BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N

Modified: trunk/boost/signals2/detail/signals_common.hpp
==============================================================================
--- trunk/boost/signals2/detail/signals_common.hpp (original)
+++ trunk/boost/signals2/detail/signals_common.hpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -15,7 +15,7 @@
 #include <boost/mpl/if.hpp>
 #include <boost/ref.hpp>
 #include <boost/signals2/signal_base.hpp>
-#include <boost/type_traits.hpp>
+#include <boost/type_traits/is_base_of.hpp>
 
 namespace boost {
   namespace signals2 {
@@ -42,6 +42,34 @@
                             reference_tag,
                             signal_or_value>::type type;
       };
+
+ // Get the slot so that it can be copied
+ template<typename F>
+ typename F::weak_signal_type
+ get_invocable_slot(const F &signal, signal_tag)
+ { return typename F::weak_signal_type(signal); }
+
+ template<typename F>
+ const F&
+ get_invocable_slot(const F& f, reference_tag)
+ { return f; }
+
+ template<typename F>
+ const F&
+ get_invocable_slot(const F& f, value_tag)
+ { return f; }
+
+ // Determines the type of the slot - is it a signal, a reference to a
+ // slot or just a normal slot.
+ template<typename F>
+ typename get_slot_tag<F>::type
+ tag_type(const F&)
+ {
+ typedef typename get_slot_tag<F>::type
+ the_tag_type;
+ the_tag_type tag = the_tag_type();
+ return tag;
+ }
     } // end namespace detail
   } // end namespace signals2
 } // end namespace boost

Modified: trunk/boost/signals2/detail/signals_common_macros.hpp
==============================================================================
--- trunk/boost/signals2/detail/signals_common_macros.hpp (original)
+++ trunk/boost/signals2/detail/signals_common_macros.hpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -11,10 +11,20 @@
 #ifndef BOOST_SIGNALS2_SIGNALS_COMMON_MACROS_HPP
 #define BOOST_SIGNALS2_SIGNALS_COMMON_MACROS_HPP
 
+#include <boost/config.hpp>
+
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
+
 #ifndef BOOST_SIGNALS2_MAX_ARGS
 #define BOOST_SIGNALS2_MAX_ARGS 9
 #endif
 
+// signaln
+#define BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity) BOOST_PP_CAT(signal, arity)
+// weak_signaln
+#define BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(arity) BOOST_PP_CAT(weak_, BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity))
+// signaln_impl
+#define BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(arity) BOOST_PP_CAT(BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity), _impl)
 // argn
 #define BOOST_SIGNALS2_SIGNATURE_ARG_NAME(z, n, data) BOOST_PP_CAT(arg, BOOST_PP_INC(n))
 // Tn argn
@@ -25,30 +35,45 @@
   BOOST_PP_ENUM(arity, BOOST_SIGNALS2_SIGNATURE_FULL_ARG, ~)
 // arg1, arg2, ..., argn
 #define BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(arity) BOOST_PP_ENUM(arity, BOOST_SIGNALS2_SIGNATURE_ARG_NAME, ~)
+// T1, T2, ..., TN
+#define BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(arity) \
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), T)
 // typename prefixR, typename prefixT1, typename prefixT2, ..., typename prefixTN
 #define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(arity, prefix) \
   typename BOOST_PP_CAT(prefix, R) BOOST_PP_COMMA_IF(arity) \
   BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename BOOST_PP_CAT(prefix, T))
 // typename R, typename T1, typename T2, ..., typename TN
 #define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity) BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(arity,)
+// typename prefixT1, typename prefixT2, ..., typename prefixTN
+#define BOOST_SIGNALS2_PREFIXED_ARGS_TEMPLATE_DECL(arity, prefix) \
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename BOOST_PP_CAT(prefix, T))
+// typename T1, typename T2, ..., typename TN
+#define BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(arity) BOOST_SIGNALS2_PREFIXED_ARGS_TEMPLATE_DECL(arity,)
 // prefixR, prefixT1, prefixT2, ..., prefixTN
 #define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(arity, prefix) \
   BOOST_PP_CAT(prefix, R) BOOST_PP_COMMA_IF(arity) BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), BOOST_PP_CAT(prefix, T))
 // R, T1, T2, ..., TN
 #define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(arity) \
   BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(arity,)
-// functionN<R, T1, T2, ..., TN>
-#define BOOST_SIGNALS2_FUNCTION_N_DECL(arity) BOOST_PP_CAT(function, arity)<\
+// boost::functionN<R, T1, T2, ..., TN>
+#define BOOST_SIGNALS2_FUNCTION_N_DECL(arity) BOOST_PP_CAT(boost::function, arity)<\
   BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(arity) >
 // R, const boost::signals2::connection&, T1, T2, ..., TN
 #define BOOST_SIGNALS2_EXT_SLOT_TEMPLATE_INSTANTIATION(arity) \
   R, const boost::signals2::connection& BOOST_PP_COMMA_IF(arity) \
   BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), T)
-// functionN<R, const boost::signals2::connection &, T1, T2, ..., TN>
-#define BOOST_SIGNALS2_EXT_FUNCTION_N_DECL(arity) BOOST_PP_CAT(function, BOOST_PP_INC(arity))<\
+// boost::functionN<R, const boost::signals2::connection &, T1, T2, ..., TN>
+#define BOOST_SIGNALS2_EXT_FUNCTION_N_DECL(arity) BOOST_PP_CAT(boost::function, BOOST_PP_INC(arity))<\
   BOOST_SIGNALS2_EXT_SLOT_TEMPLATE_INSTANTIATION(arity) >
 // slotN
 #define BOOST_SIGNALS2_SLOT_CLASS_NAME(arity) BOOST_PP_CAT(slot, arity)
+// slotN+1<R, const connection &, T1, T2, ..., TN, extended_slot_function_type>
+#define BOOST_SIGNALS2_EXTENDED_SLOT_TYPE(arity) \
+ BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_PP_INC(arity))< \
+ BOOST_SIGNALS2_EXT_SLOT_TEMPLATE_INSTANTIATION(arity), \
+ extended_slot_function_type>
+// bound_extended_slot_functionN
+#define BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(arity) BOOST_PP_CAT(bound_extended_slot_function, arity)
 // typename function_traits<Signature>::argn_type
 #define BOOST_SIGNALS2_SIGNATURE_TO_ARGN_TYPE(z, n, Signature) \
   BOOST_PP_CAT(BOOST_PP_CAT(typename function_traits<Signature>::arg, BOOST_PP_INC(n)), _type)
@@ -60,5 +85,110 @@
 #define BOOST_SIGNALS2_PORTABLE_SIGNATURE(arity, Signature) \
   typename function_traits<Signature>::result_type \
   BOOST_PP_COMMA_IF(arity) BOOST_PP_ENUM(arity, BOOST_SIGNALS2_SIGNATURE_TO_ARGN_TYPE, Signature)
+// prefixTn & argn
+#define BOOST_SIGNALS2_PREFIXED_FULL_REF_ARG(z, n, prefix) \
+ BOOST_PP_CAT(BOOST_PP_CAT(prefix, T), BOOST_PP_INC(n)) & BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~)
+// prefixT1 & arg1, prefixT2 & arg2, ..., prefixTn & argn
+#define BOOST_SIGNALS2_PREFIXED_FULL_REF_ARGS(arity, prefix) \
+ BOOST_PP_ENUM(arity, BOOST_SIGNALS2_PREFIXED_FULL_REF_ARG, prefix)
+// T1 & arg1, T2 & arg2, ..., Tn & argn
+#define BOOST_SIGNALS2_FULL_REF_ARGS(arity) BOOST_SIGNALS2_PREFIXED_FULL_REF_ARGS(arity,)
+// preprocessed_arg_typeN
+#define BOOST_SIGNALS2_PREPROCESSED_ARG_N_TYPE_CLASS_NAME(arity) BOOST_PP_CAT(preprocessed_arg_type, arity)
+
+// typename R, typename T1, typename T2, ..., typename TN, typename SlotFunction
+#define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION_DECL(arity) \
+ BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity), \
+ typename SlotFunction
+#define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION
+
+// typename R, typename T1, typename T2, ..., typename TN, typename Combiner, ...
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(arity) \
+ BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity), \
+ typename Combiner, \
+ typename Group, \
+ typename GroupCompare, \
+ typename SlotFunction, \
+ typename ExtendedSlotFunction, \
+ typename Mutex
+// typename R, typename T1, typename T2, ..., typename TN, typename Combiner = optional_last_value<R>, ...
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL(arity) \
+ BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity), \
+ typename Combiner = optional_last_value<R>, \
+ typename Group = int, \
+ typename GroupCompare = std::less<Group>, \
+ typename SlotFunction = BOOST_SIGNALS2_FUNCTION_N_DECL(arity), \
+ typename ExtendedSlotFunction = BOOST_SIGNALS2_EXT_FUNCTION_N_DECL(arity), \
+ typename Mutex = signals2::mutex
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(arity) BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(arity)
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION
+
+#define BOOST_SIGNALS2_PP_COMMA_IF(arity) BOOST_PP_COMMA_IF(arity)
+
+#else // BOOST_NO_VARIADIC_TEMPLATES
+
+#define BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity) signal
+#define BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(arity) weak_signal
+#define BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(arity) signal_impl
+#define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity) typename Signature
+#define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(arity) R (Args...)
+#define BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(arity) typename ... Args
+#define BOOST_SIGNALS2_FULL_REF_ARGS(arity) Args & ... args
+#define BOOST_SIGNALS2_SLOT_CLASS_NAME(arity) slot
+#define BOOST_SIGNALS2_EXTENDED_SLOT_TYPE(arity) slot<R (const connection &, Args...), extended_slot_function_type>
+#define BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(arity) bound_extended_slot_function
+#define BOOST_SIGNALS2_FUNCTION_N_DECL(arity) boost::function<Signature>
+#define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(arity, prefix) typename prefixSignature
+#define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(arity, prefix) prefixSignature
+#define BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(arity) Args ... args
+#define BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(arity) args...
+#define BOOST_SIGNALS2_PORTABLE_SIGNATURE(arity, Signature) Signature
+#define BOOST_SIGNALS2_EXT_SLOT_TEMPLATE_INSTANTIATION(arity) R (Args...)
+#define BOOST_SIGNALS2_SLOT_CLASS_NAME(arity) slot
+
+#define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION_DECL(arity) \
+ typename SlotFunction, \
+ typename R, \
+ typename ... Args
+#define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION \
+ <R (Args...), SlotFunction>
+
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(arity) \
+ typename Signature, \
+ typename Combiner, \
+ typename Group, \
+ typename GroupCompare, \
+ typename SlotFunction, \
+ typename ExtendedSlotFunction, \
+ typename Mutex
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL(arity) \
+ typename Signature, \
+ typename Combiner = optional_last_value<typename boost::function_traits<Signature>::result_type>, \
+ typename Group = int, \
+ typename GroupCompare = std::less<Group>, \
+ typename SlotFunction = boost::function<Signature>, \
+ typename ExtendedSlotFunction = typename detail::variadic_extended_signature<Signature>::function_type, \
+ typename Mutex = signals2::mutex
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(arity) \
+ typename Combiner, \
+ typename Group, \
+ typename GroupCompare, \
+ typename SlotFunction, \
+ typename ExtendedSlotFunction, \
+ typename Mutex, \
+ typename R, \
+ typename ... Args
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION <\
+ R (Args...), \
+ Combiner, \
+ Group, \
+ GroupCompare, \
+ SlotFunction, \
+ ExtendedSlotFunction, \
+ Mutex>
+
+#define BOOST_SIGNALS2_PP_COMMA_IF(arity) ,
+
+#endif // BOOST_NO_VARIADIC_TEMPLATES
 
 #endif // BOOST_SIGNALS2_SIGNALS_COMMON_MACROS_HPP

Modified: trunk/boost/signals2/detail/slot_template.hpp
==============================================================================
--- trunk/boost/signals2/detail/slot_template.hpp (original)
+++ trunk/boost/signals2/detail/slot_template.hpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -11,7 +11,12 @@
 
 // This file is included iteratively, and should not be protected from multiple inclusion
 
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
 #define BOOST_SIGNALS2_NUM_ARGS BOOST_PP_ITERATION()
+#else
+#define BOOST_SIGNALS2_NUM_ARGS 1
+#endif
+
 
 namespace boost
 {
@@ -22,7 +27,11 @@
     // slot class template.
     template<BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS),
       typename SlotFunction = BOOST_SIGNALS2_FUNCTION_N_DECL(BOOST_SIGNALS2_NUM_ARGS)>
- class BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS): public slot_base
+ class BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
+
+ template<BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS) BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION
+ : public slot_base
     {
     public:
       template<BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS, Other), typename OtherSlotFunction>
@@ -30,6 +39,8 @@
 
       typedef SlotFunction slot_function_type;
       typedef R result_type;
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
+
 // typedef Tn argn_type;
 #define BOOST_SIGNALS2_MISC_STATEMENT(z, n, data) \
     typedef BOOST_PP_CAT(T, BOOST_PP_INC(n)) BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(n)), _type);
@@ -41,35 +52,47 @@
       typedef arg1_type first_argument_type;
       typedef arg2_type second_argument_type;
 #endif
+
+ template<unsigned n> class arg : public
+ detail::BOOST_SIGNALS2_PREPROCESSED_ARG_N_TYPE_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <n BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS)>
+ {};
+
       BOOST_STATIC_CONSTANT(int, arity = BOOST_SIGNALS2_NUM_ARGS);
 
+#else // BOOST_NO_VARIADIC_TEMPLATES
+
+ template<unsigned n> class arg
+ {
+ public:
+ typedef typename detail::variadic_arg_type<n, Args...>::type type;
+ };
+ BOOST_STATIC_CONSTANT(int, arity = detail::vararg_count<Args...>::value);
+
+#endif // BOOST_NO_VARIADIC_TEMPLATES
+
       template<typename F>
       BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const F& f)
       {
         init_slot_function(f);
       }
       // copy constructors
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
       template<BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS, Other), typename OtherSlotFunction>
       BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
         <BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS, Other), OtherSlotFunction> &other_slot):
         slot_base(other_slot), _slot_function(other_slot._slot_function)
       {
       }
+#endif
       template<typename Signature, typename OtherSlotFunction>
       BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const slot<Signature, OtherSlotFunction> &other_slot):
         slot_base(other_slot), _slot_function(other_slot._slot_function)
       {
       }
       // bind syntactic sugar
-// template<typename Func, typename ArgType0, typename ArgType1, ..., typename ArgTypen-1> slotN(...
-#define BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTOR(z, n, data) \
- template<typename Func, BOOST_PP_ENUM_PARAMS(n, typename ArgType)> \
- BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const Func &func, BOOST_PP_ENUM(n, BOOST_SIGNALS2_SLOT_BINDING_ARG_DECL, ~)) \
- { \
- init_slot_function(boost::bind(func, BOOST_PP_ENUM_PARAMS(n, arg))); \
- }
- BOOST_PP_REPEAT_FROM_TO(1, BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS, BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTOR, ~)
-#undef BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTOR
+ BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTORS
       // invocation
       R operator()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS))
       {
@@ -116,6 +139,7 @@
       SlotFunction _slot_function;
     };
 
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
     namespace detail
     {
       template<unsigned arity, typename Signature, typename SlotFunction>
@@ -130,6 +154,7 @@
           SlotFunction> type;
       };
     }
+#endif
   } // end namespace signals2
 } // end namespace boost
 

Added: trunk/boost/signals2/detail/variadic_arg_type.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/signals2/detail/variadic_arg_type.hpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -0,0 +1,53 @@
+// Copyright Frank Mori Hess 2009
+//
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_DETAIL_VARIADIC_ARG_TYPE_HPP
+#define BOOST_SIGNALS2_DETAIL_VARIADIC_ARG_TYPE_HPP
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ template<unsigned, typename ... Args> class variadic_arg_type;
+
+ template<typename T, typename ... Args> class variadic_arg_type<0, T, Args...>
+ {
+ public:
+ typedef T type;
+ };
+
+ template<unsigned n, typename T, typename ... Args> class variadic_arg_type<n, T, Args...>
+ {
+ public:
+ typedef typename variadic_arg_type<n - 1, Args...>::type type;
+ };
+
+ template<typename ... Args> class vararg_count;
+
+ template<>
+ class vararg_count<>
+ {
+ public:
+ static const unsigned value = 0;
+ };
+
+ template<typename T, typename ... Args>
+ class vararg_count<T, Args...>
+ {
+ public:
+ static const unsigned value = vararg_count<Args...>::value + 1;
+ };
+ } // namespace detail
+ } // namespace signals2
+} // namespace boost
+
+
+#endif // BOOST_SIGNALS2_DETAIL_VARIADIC_ARG_TYPE_HPP

Added: trunk/boost/signals2/detail/variadic_slot_invoker.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/signals2/detail/variadic_slot_invoker.hpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -0,0 +1,123 @@
+/*
+ Helper class used by variadic implementation of variadic boost::signals2::signal.
+
+ Author: Frank Mori Hess <fmhess_at_[hidden]>
+ Begin: 2009-05-27
+*/
+// Copyright Frank Mori Hess 2009
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_DETAIL_VARIADIC_SLOT_INVOKER_HPP
+#define BOOST_SIGNALS2_DETAIL_VARIADIC_SLOT_INVOKER_HPP
+
+#include <boost/signals2/detail/variadic_arg_type.hpp>
+// if compiler has variadic template support, we assume they have
+// a variadic std::tuple implementation here. We don't use boost::tuple
+// because it does not have variadic template support at present.
+#include <tuple>
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ template<unsigned ... values> class unsigned_meta_array {};
+
+ template<typename UnsignedMetaArray, unsigned n> class unsigned_meta_array_appender;
+
+ template<unsigned n, unsigned ... Args>
+ class unsigned_meta_array_appender<unsigned_meta_array<Args...>, n>
+ {
+ public:
+ typedef unsigned_meta_array<Args..., n> type;
+ };
+
+ template<unsigned n> class make_unsigned_meta_array;
+
+ template<> class make_unsigned_meta_array<0>
+ {
+ public:
+ typedef unsigned_meta_array<> type;
+ };
+
+ template<> class make_unsigned_meta_array<1>
+ {
+ public:
+ typedef unsigned_meta_array<0> type;
+ };
+
+ template<unsigned n> class make_unsigned_meta_array
+ {
+ public:
+ typedef typename unsigned_meta_array_appender<typename make_unsigned_meta_array<n-1>::type, n - 1>::type type;
+ };
+
+ template<typename R>
+ class call_with_tuple_args
+ {
+ public:
+ typedef R result_type;
+
+ template<typename Func, typename ... Args>
+ R operator()(Func &func, std::tuple<Args...> args) const
+ {
+ typedef typename make_unsigned_meta_array<vararg_count<Args...>::value>::type indices_type;
+ typename Func::result_type *resolver = 0;
+ return m_invoke(resolver, func, indices_type(), args);
+ }
+ private:
+ template<typename T, typename Func, unsigned ... indices, typename ... Args>
+ R m_invoke(T *, Func &func, unsigned_meta_array<indices...>, std::tuple<Args...> args) const
+ {
+ return func(std::get<indices>(args)...);
+ }
+ template<typename Func, unsigned ... indices, typename ... Args>
+ R m_invoke(void *, Func &func, unsigned_meta_array<indices...>, std::tuple<Args...> args) const
+ {
+ func(std::get<indices>(args)...);
+ return R();
+ }
+ };
+
+ template<typename R, typename ... Args>
+ class variadic_slot_invoker
+ {
+ public:
+ typedef R result_type;
+
+ variadic_slot_invoker(Args & ... args): _args(args...)
+ {}
+ template<typename ConnectionBodyType>
+ result_type operator ()(const ConnectionBodyType &connectionBody) const
+ {
+ result_type *resolver = 0;
+ return m_invoke(connectionBody,
+ resolver);
+ }
+ private:
+ template<typename ConnectionBodyType>
+ result_type m_invoke(const ConnectionBodyType &connectionBody,
+ const void_type *) const
+ {
+ return call_with_tuple_args<result_type>()(connectionBody->slot.slot_function(), _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);
+ }
+ std::tuple<Args& ...> _args;
+ };
+ } // namespace detail
+ } // namespace signals2
+} // namespace boost
+
+
+#endif // BOOST_SIGNALS2_DETAIL_VARIADIC_SLOT_INVOKER_HPP

Copied: trunk/boost/signals2/preprocessed_signal.hpp (from r53280, /trunk/boost/signals2/signal.hpp)
==============================================================================
--- /trunk/boost/signals2/signal.hpp (original)
+++ trunk/boost/signals2/preprocessed_signal.hpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -12,54 +12,14 @@
 
 // For more information, see http://www.boost.org
 
-#ifndef BOOST_SIGNALS2_SIGNAL_HPP
-#define BOOST_SIGNALS2_SIGNAL_HPP
+#ifndef BOOST_SIGNALS2_PREPROCESSED_SIGNAL_HPP
+#define BOOST_SIGNALS2_PREPROCESSED_SIGNAL_HPP
 
-#include <algorithm>
-#include <boost/assert.hpp>
-#include <boost/config.hpp>
-#include <boost/function.hpp>
 #include <boost/preprocessor/arithmetic.hpp>
 #include <boost/preprocessor/cat.hpp>
 #include <boost/preprocessor/iteration.hpp>
 #include <boost/preprocessor/repetition.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/signals2/detail/unique_lock.hpp>
-#include <boost/signals2/optional_last_value.hpp>
-#include <boost/signals2/detail/result_type_wrapper.hpp>
-#include <boost/signals2/detail/signals_common.hpp>
-#include <boost/signals2/detail/signals_common_macros.hpp>
-#include <boost/signals2/detail/slot_groups.hpp>
-#include <boost/signals2/detail/slot_call_iterator.hpp>
-#include <boost/signals2/mutex.hpp>
-#include <boost/signals2/connection.hpp>
-#include <boost/signals2/slot.hpp>
-#include <boost/throw_exception.hpp>
-#include <boost/type_traits.hpp>
-#include <functional>
-
-namespace boost
-{
- namespace signals2
- {
- namespace detail
- {
- template<typename ResultSlot, typename SlotIn, typename SlotFunction>
- ResultSlot replace_slot_function(const SlotIn &slot_in, const SlotFunction &fun)
- {
- ResultSlot slot(fun);
- slot_base::tracked_container_type tracked_objects = slot_in.tracked_objects();
- slot_base::tracked_container_type::const_iterator it;
- for(it = tracked_objects.begin(); it != tracked_objects.end(); ++it)
- {
- slot.track(*it);
- }
- return slot;
- }
- } // namespace detail
- } // namespace signals2
-} // namespace boost
-
+#include <boost/signals2/detail/preprocessed_arg_type.hpp>
 
 #define BOOST_PP_ITERATION_LIMITS (0, BOOST_SIGNALS2_MAX_ARGS)
 #define BOOST_PP_FILENAME_1 <boost/signals2/detail/signal_template.hpp>
@@ -91,4 +51,4 @@
   }
 }
 
-#endif // BOOST_SIGNALS2_SIGNAL_HPP
+#endif // BOOST_SIGNALS2_PREPROCESSED_SIGNAL_HPP

Copied: trunk/boost/signals2/preprocessed_slot.hpp (from r53280, /trunk/boost/signals2/slot.hpp)
==============================================================================
--- /trunk/boost/signals2/slot.hpp (original)
+++ trunk/boost/signals2/preprocessed_slot.hpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -1,6 +1,6 @@
 // Boost.Signals2 library
 
-// Copyright Frank Mori Hess 2007-2008.
+// Copyright Frank Mori Hess 2007-2009.
 // Copyright Timmo Stange 2007.
 // Copyright Douglas Gregor 2001-2004. Use, modification and
 // distribution is subject to the Boost Software License, Version
@@ -9,70 +9,37 @@
 
 // For more information, see http://www.boost.org
 
-#ifndef BOOST_SIGNALS2_SLOT_HPP
-#define BOOST_SIGNALS2_SLOT_HPP
+#ifndef BOOST_SIGNALS2_PREPROCESSED_SLOT_HPP
+#define BOOST_SIGNALS2_PREPROCESSED_SLOT_HPP
 
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
 #include <boost/preprocessor/repetition.hpp>
-#include <boost/ref.hpp>
-#include <boost/signals2/detail/signals_common.hpp>
-#include <boost/signals2/detail/signals_common_macros.hpp>
-#include <boost/signals2/detail/tracked_objects_visitor.hpp>
-#include <boost/signals2/slot_base.hpp>
-#include <boost/type_traits.hpp>
-#include <boost/visit_each.hpp>
-#include <boost/weak_ptr.hpp>
-
+#include <boost/signals2/detail/preprocessed_arg_type.hpp>
+#include <boost/type_traits/function_traits.hpp>
 
 #ifndef BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS
 #define BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS 10
 #endif
-// const ArgTypeN & argN
-#define BOOST_SIGNALS2_SLOT_BINDING_ARG_DECL(z, n, data) \
- const BOOST_PP_CAT(ArgType, n) & BOOST_PP_CAT(arg, n)
-
-namespace boost
-{
- namespace signals2
- {
- namespace detail
- {
- // Get the slot so that it can be copied
- template<typename F>
- typename F::weak_signal_type
- get_invocable_slot(const F &signal, signal_tag)
- { return typename F::weak_signal_type(signal); }
-
- template<typename F>
- const F&
- get_invocable_slot(const F& f, reference_tag)
- { return f; }
 
- template<typename F>
- const F&
- get_invocable_slot(const F& f, value_tag)
- { return f; }
 
- // Determines the type of the slot - is it a signal, a reference to a
- // slot or just a normal slot.
- template<typename F>
- typename get_slot_tag<F>::type
- tag_type(const F&)
- {
- typedef typename get_slot_tag<F>::type
- the_tag_type;
- the_tag_type tag = the_tag_type();
- return tag;
- }
- }
+// template<typename Func, typename BindArgT0, typename BindArgT1, ..., typename BindArgTN-1> slotN(...
+#define BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTOR(z, n, data) \
+ template<typename Func, BOOST_SIGNALS2_PREFIXED_ARGS_TEMPLATE_DECL(n, BindArg)> \
+ BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)( \
+ const Func &func, BOOST_SIGNALS2_PREFIXED_FULL_REF_ARGS(n, const BindArg)) \
+ { \
+ init_slot_function(boost::bind(func, BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(n))); \
   }
-} // end namespace boost
+#define BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTORS \
+ BOOST_PP_REPEAT_FROM_TO(1, BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS, BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTOR, ~)
+
 
 #define BOOST_PP_ITERATION_LIMITS (0, BOOST_PP_INC(BOOST_SIGNALS2_MAX_ARGS))
 #define BOOST_PP_FILENAME_1 <boost/signals2/detail/slot_template.hpp>
 #include BOOST_PP_ITERATE()
 
+#undef BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTOR
+#undef BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTORS
+
 namespace boost
 {
   namespace signals2
@@ -90,11 +57,11 @@
       slot(const F& f): base_type(f)
       {}
       // bind syntactic sugar
-// template<typename F, typename ArgType0, typename ArgType1, ..., typename ArgTypen-1> slot(...
+// template<typename F, typename BindArgT0, typename BindArgT1, ..., typename BindArgTn-1> slot(...
 #define BOOST_SIGNALS2_SLOT_BINDING_CONSTRUCTOR(z, n, data) \
- template<typename F, BOOST_PP_ENUM_PARAMS(n, typename ArgType)> \
- slot(const F &f, BOOST_PP_ENUM(n, BOOST_SIGNALS2_SLOT_BINDING_ARG_DECL, ~)): \
- base_type(f, BOOST_PP_ENUM_PARAMS(n, arg)) \
+ template<typename Func, BOOST_SIGNALS2_PREFIXED_ARGS_TEMPLATE_DECL(n, BindArg)> \
+ slot(const Func &func, BOOST_SIGNALS2_PREFIXED_FULL_REF_ARGS(n, const BindArg)): \
+ base_type(func, BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(n)) \
   {}
       BOOST_PP_REPEAT_FROM_TO(1, BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS, BOOST_SIGNALS2_SLOT_BINDING_CONSTRUCTOR, ~)
 #undef BOOST_SIGNALS2_SLOT_BINDING_CONSTRUCTOR
@@ -102,4 +69,4 @@
   } // namespace signals2
 }
 
-#endif // BOOST_SIGNALS2_SLOT_HPP
+#endif // BOOST_SIGNALS2_PREPROCESSED_SLOT_HPP

Deleted: trunk/boost/signals2/signal.hpp
==============================================================================
--- trunk/boost/signals2/signal.hpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
+++ (empty file)
@@ -1,94 +0,0 @@
-/*
- A thread-safe version of Boost.Signals.
-
- Author: Frank Mori Hess <fmhess_at_[hidden]>
- Begin: 2007-01-23
-*/
-// Copyright Frank Mori Hess 2007-2008
-// Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS2_SIGNAL_HPP
-#define BOOST_SIGNALS2_SIGNAL_HPP
-
-#include <algorithm>
-#include <boost/assert.hpp>
-#include <boost/config.hpp>
-#include <boost/function.hpp>
-#include <boost/preprocessor/arithmetic.hpp>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/iteration.hpp>
-#include <boost/preprocessor/repetition.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/signals2/detail/unique_lock.hpp>
-#include <boost/signals2/optional_last_value.hpp>
-#include <boost/signals2/detail/result_type_wrapper.hpp>
-#include <boost/signals2/detail/signals_common.hpp>
-#include <boost/signals2/detail/signals_common_macros.hpp>
-#include <boost/signals2/detail/slot_groups.hpp>
-#include <boost/signals2/detail/slot_call_iterator.hpp>
-#include <boost/signals2/mutex.hpp>
-#include <boost/signals2/connection.hpp>
-#include <boost/signals2/slot.hpp>
-#include <boost/throw_exception.hpp>
-#include <boost/type_traits.hpp>
-#include <functional>
-
-namespace boost
-{
- namespace signals2
- {
- namespace detail
- {
- template<typename ResultSlot, typename SlotIn, typename SlotFunction>
- ResultSlot replace_slot_function(const SlotIn &slot_in, const SlotFunction &fun)
- {
- ResultSlot slot(fun);
- slot_base::tracked_container_type tracked_objects = slot_in.tracked_objects();
- slot_base::tracked_container_type::const_iterator it;
- for(it = tracked_objects.begin(); it != tracked_objects.end(); ++it)
- {
- slot.track(*it);
- }
- return slot;
- }
- } // namespace detail
- } // namespace signals2
-} // namespace boost
-
-
-#define BOOST_PP_ITERATION_LIMITS (0, BOOST_SIGNALS2_MAX_ARGS)
-#define BOOST_PP_FILENAME_1 <boost/signals2/detail/signal_template.hpp>
-#include BOOST_PP_ITERATE()
-
-namespace boost
-{
- namespace signals2
- {
- template<typename Signature,
- typename Combiner = optional_last_value<typename boost::function_traits<Signature>::result_type>,
- typename Group = int,
- typename GroupCompare = std::less<Group>,
- typename SlotFunction = function<Signature>,
- typename ExtendedSlotFunction = typename detail::extended_signature<function_traits<Signature>::arity, Signature>::function_type,
- typename Mutex = mutex >
- class signal: public detail::signalN<function_traits<Signature>::arity,
- Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>::type
- {
- private:
- typedef typename detail::signalN<boost::function_traits<Signature>::arity,
- Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>::type base_type;
- public:
- typedef Signature signature_type;
- signal(const Combiner &combiner = Combiner(), const GroupCompare &group_compare = GroupCompare()):
- base_type(combiner, group_compare)
- {}
- };
- }
-}
-
-#endif // BOOST_SIGNALS2_SIGNAL_HPP

Deleted: trunk/boost/signals2/slot.hpp
==============================================================================
--- trunk/boost/signals2/slot.hpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
+++ (empty file)
@@ -1,105 +0,0 @@
-// Boost.Signals2 library
-
-// Copyright Frank Mori Hess 2007-2008.
-// Copyright Timmo Stange 2007.
-// Copyright Douglas Gregor 2001-2004. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS2_SLOT_HPP
-#define BOOST_SIGNALS2_SLOT_HPP
-
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
-#include <boost/preprocessor/repetition.hpp>
-#include <boost/ref.hpp>
-#include <boost/signals2/detail/signals_common.hpp>
-#include <boost/signals2/detail/signals_common_macros.hpp>
-#include <boost/signals2/detail/tracked_objects_visitor.hpp>
-#include <boost/signals2/slot_base.hpp>
-#include <boost/type_traits.hpp>
-#include <boost/visit_each.hpp>
-#include <boost/weak_ptr.hpp>
-
-
-#ifndef BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS
-#define BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS 10
-#endif
-// const ArgTypeN & argN
-#define BOOST_SIGNALS2_SLOT_BINDING_ARG_DECL(z, n, data) \
- const BOOST_PP_CAT(ArgType, n) & BOOST_PP_CAT(arg, n)
-
-namespace boost
-{
- namespace signals2
- {
- namespace detail
- {
- // Get the slot so that it can be copied
- template<typename F>
- typename F::weak_signal_type
- get_invocable_slot(const F &signal, signal_tag)
- { return typename F::weak_signal_type(signal); }
-
- template<typename F>
- const F&
- get_invocable_slot(const F& f, reference_tag)
- { return f; }
-
- template<typename F>
- const F&
- get_invocable_slot(const F& f, value_tag)
- { return f; }
-
- // Determines the type of the slot - is it a signal, a reference to a
- // slot or just a normal slot.
- template<typename F>
- typename get_slot_tag<F>::type
- tag_type(const F&)
- {
- typedef typename get_slot_tag<F>::type
- the_tag_type;
- the_tag_type tag = the_tag_type();
- return tag;
- }
- }
- }
-} // end namespace boost
-
-#define BOOST_PP_ITERATION_LIMITS (0, BOOST_PP_INC(BOOST_SIGNALS2_MAX_ARGS))
-#define BOOST_PP_FILENAME_1 <boost/signals2/detail/slot_template.hpp>
-#include BOOST_PP_ITERATE()
-
-namespace boost
-{
- namespace signals2
- {
- template<typename Signature,
- typename SlotFunction = boost::function<Signature> >
- class slot: public detail::slotN<function_traits<Signature>::arity,
- Signature, SlotFunction>::type
- {
- private:
- typedef typename detail::slotN<boost::function_traits<Signature>::arity,
- Signature, SlotFunction>::type base_type;
- public:
- template<typename F>
- slot(const F& f): base_type(f)
- {}
- // bind syntactic sugar
-// template<typename F, typename ArgType0, typename ArgType1, ..., typename ArgTypen-1> slot(...
-#define BOOST_SIGNALS2_SLOT_BINDING_CONSTRUCTOR(z, n, data) \
- template<typename F, BOOST_PP_ENUM_PARAMS(n, typename ArgType)> \
- slot(const F &f, BOOST_PP_ENUM(n, BOOST_SIGNALS2_SLOT_BINDING_ARG_DECL, ~)): \
- base_type(f, BOOST_PP_ENUM_PARAMS(n, arg)) \
- {}
- BOOST_PP_REPEAT_FROM_TO(1, BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS, BOOST_SIGNALS2_SLOT_BINDING_CONSTRUCTOR, ~)
-#undef BOOST_SIGNALS2_SLOT_BINDING_CONSTRUCTOR
- };
- } // namespace signals2
-}
-
-#endif // BOOST_SIGNALS2_SLOT_HPP

Added: trunk/boost/signals2/variadic_signal.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/signals2/variadic_signal.hpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -0,0 +1,43 @@
+/*
+ A variadic implementation of variadic boost::signals2::signal, used when variadic
+ template support is detected in the compiler.
+
+ Author: Frank Mori Hess <fmhess_at_[hidden]>
+ Begin: 2009-05-26
+*/
+// Copyright Frank Mori Hess 2009
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_VARIADIC_SIGNAL_HPP
+#define BOOST_SIGNALS2_VARIADIC_SIGNAL_HPP
+
+#include <boost/signals2/detail/variadic_arg_type.hpp>
+#include <boost/signals2/detail/variadic_slot_invoker.hpp>
+#include <boost/type_traits/function_traits.hpp>
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ template<typename Signature> class variadic_extended_signature;
+ // partial template specialization
+ template<typename R, typename ... Args>
+ class variadic_extended_signature<R (Args...)>
+ {
+ public:
+ typedef boost::function<R (const boost::signals2::connection &, Args...)> function_type;
+ };
+ } // namespace detail
+ } // namespace signals2
+} // namespace boost
+
+#include <boost/signals2/detail/signal_template.hpp>
+
+#endif // BOOST_SIGNALS2_VARIADIC_SIGNAL_HPP

Added: trunk/boost/signals2/variadic_slot.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/signals2/variadic_slot.hpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -0,0 +1,24 @@
+// Boost.Signals2 library
+
+// Copyright Frank Mori Hess 2009.
+//
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_VARIADIC_SLOT_HPP
+#define BOOST_SIGNALS2_VARIADIC_SLOT_HPP
+
+#include <boost/signals2/detail/variadic_arg_type.hpp>
+
+#define BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTORS \
+ template<typename ... BindArgs> slot(const BindArgs & ... args) \
+ { \
+ init_slot_function(boost::bind(args...)); \
+ }
+
+
+#include <boost/signals2/detail/slot_template.hpp>
+#endif // BOOST_SIGNALS2_VARIADIC_SLOT_HPP

Modified: trunk/libs/signals2/test/connection_test.cpp
==============================================================================
--- trunk/libs/signals2/test/connection_test.cpp (original)
+++ trunk/libs/signals2/test/connection_test.cpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -14,7 +14,7 @@
 
 namespace bs2 = boost::signals2;
 
-typedef bs2::signal0<void> sig_type;
+typedef bs2::signal<void ()> sig_type;
 
 void myslot()
 {}

Modified: trunk/libs/signals2/test/dead_slot_test.cpp
==============================================================================
--- trunk/libs/signals2/test/dead_slot_test.cpp (original)
+++ trunk/libs/signals2/test/dead_slot_test.cpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -12,7 +12,7 @@
 #include <boost/signals2.hpp>
 #include <boost/bind.hpp>
 
-typedef boost::signals2::signal1<int, int> sig_type;
+typedef boost::signals2::signal<int (int)> sig_type;
 
 class with_constant {
 public:

Modified: trunk/libs/signals2/test/deletion_test.cpp
==============================================================================
--- trunk/libs/signals2/test/deletion_test.cpp (original)
+++ trunk/libs/signals2/test/deletion_test.cpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -40,7 +40,7 @@
 static void
 test_remove_self()
 {
- boost::signals2::signal0<void> s0;
+ boost::signals2::signal<void ()> s0;
 
   connections[0] = s0.connect(remove_connection(0));
   connections[1] = s0.connect(remove_connection(1));
@@ -115,7 +115,7 @@
 static void
 test_remove_prior()
 {
- boost::signals2::signal0<void> s0;
+ boost::signals2::signal<void ()> s0;
 
   connections[0] = s0.connect(remove_connection(0));
   connections[1] = s0.connect(remove_connection(1, 0));
@@ -154,7 +154,7 @@
 static void
 test_remove_after()
 {
- boost::signals2::signal0<void> s0;
+ boost::signals2::signal<void ()> s0;
 
   connections[0] = s0.connect(remove_connection(0, 1));
   connections[1] = s0.connect(remove_connection(1));
@@ -193,7 +193,7 @@
 static void
 test_bloodbath()
 {
- boost::signals2::signal0<void> s0;
+ boost::signals2::signal<void ()> s0;
 
   connections[0] = s0.connect(remove_connection(0, 1));
   connections[1] = s0.connect(remove_connection(1, 1));
@@ -214,7 +214,7 @@
 static void
 test_disconnect_equal()
 {
- boost::signals2::signal0<void> s0;
+ boost::signals2::signal<void ()> s0;
 
   connections[0] = s0.connect(remove_connection(0));
   connections[1] = s0.connect(remove_connection(1));

Modified: trunk/libs/signals2/test/ordering_test.cpp
==============================================================================
--- trunk/libs/signals2/test/ordering_test.cpp (original)
+++ trunk/libs/signals2/test/ordering_test.cpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -68,7 +68,7 @@
 
   std::vector<int> sortedValues;
 
- boost::signals2::signal0<void> sig;
+ boost::signals2::signal<void ()> sig;
   sig.connect(write_ungrouped1());
   for (int i = 0; i < 100; ++i) {
 #ifdef BOOST_NO_STDC_NAMESPACE

Modified: trunk/libs/signals2/test/regression_test.cpp
==============================================================================
--- trunk/libs/signals2/test/regression_test.cpp (original)
+++ trunk/libs/signals2/test/regression_test.cpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -13,7 +13,7 @@
 #include <boost/test/minimal.hpp>
 #include <boost/signals2.hpp>
 
-typedef boost::signals2::signal0<void> sig0_type;
+typedef boost::signals2::signal<void ()> sig0_type;
 
 // combiner that returns the number of slots invoked
 struct slot_counter {
@@ -64,7 +64,7 @@
 /* 2008-03-10: we weren't disconnecting old connection in scoped_connection assignment operator */
 void scoped_connection_test()
 {
- typedef boost::signals2::signal0<void, slot_counter> signal_type;
+ typedef boost::signals2::signal<void (), slot_counter> signal_type;
   signal_type sig;
   {
     boost::signals2::scoped_connection conn(sig.connect(&my_slot));

Modified: trunk/libs/signals2/test/shared_connection_block_test.cpp
==============================================================================
--- trunk/libs/signals2/test/shared_connection_block_test.cpp (original)
+++ trunk/libs/signals2/test/shared_connection_block_test.cpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -33,7 +33,7 @@
 
 int test_main(int, char* [])
 {
- boost::signals2::signal0<void> s0;
+ boost::signals2::signal<void ()> s0;
 
   for(unsigned i = 0; i < connections.size(); ++i)
   {

Modified: trunk/libs/signals2/test/signal_n_test.cpp
==============================================================================
--- trunk/libs/signals2/test/signal_n_test.cpp (original)
+++ trunk/libs/signals2/test/signal_n_test.cpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -7,9 +7,18 @@
 
 // For more information, see http://www.boost.org
 
+#include <boost/config.hpp>
+#include <boost/test/minimal.hpp>
+
+#ifndef BOOST_NO_VARIADIC_TEMPLATES
+int test_main(int, char* [])
+{
+ return 0;
+}
+#else // BOOST_NO_VARIADIC_TEMPLATES
+
 #include <boost/optional.hpp>
 #include <boost/ref.hpp>
-#include <boost/test/minimal.hpp>
 #include <boost/signals2.hpp>
 #include <functional>
 
@@ -290,3 +299,5 @@
   test_extended_slot<int>();
   return 0;
 }
+
+#endif // BOOST_NO_VARIADIC_TEMPLATES

Modified: trunk/libs/signals2/test/signal_test.cpp
==============================================================================
--- trunk/libs/signals2/test/signal_test.cpp (original)
+++ trunk/libs/signals2/test/signal_test.cpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -226,7 +226,7 @@
 static void
 test_reference_args()
 {
- typedef boost::signals2::signal<void (int &value)> signal_type;
+ typedef boost::signals2::signal<void (int &)> signal_type;
   signal_type s1;
 
   s1.connect(&increment_arg);
@@ -235,6 +235,24 @@
   BOOST_CHECK(value == 1);
 }
 
+static void
+test_typedefs_etc()
+{
+ typedef boost::signals2::signal<int (double, long)> signal_type;
+ typedef signal_type::slot_type slot_type;
+
+ BOOST_CHECK(typeid(signal_type::slot_result_type) == typeid(int));
+ BOOST_CHECK(typeid(signal_type::result_type) == typeid(boost::optional<int>));
+ BOOST_CHECK(typeid(signal_type::arg<0>::type) == typeid(double));
+ BOOST_CHECK(typeid(signal_type::arg<1>::type) == typeid(long));
+ BOOST_CHECK(signal_type::arity == 2);
+
+ BOOST_CHECK(typeid(slot_type::result_type) == typeid(signal_type::slot_result_type));
+ BOOST_CHECK(typeid(slot_type::arg<0>::type) == typeid(signal_type::arg<0>::type));
+ BOOST_CHECK(typeid(slot_type::arg<1>::type) == typeid(signal_type::arg<1>::type));
+ BOOST_CHECK(slot_type::arity == signal_type::arity);
+}
+
 int
 test_main(int, char* [])
 {
@@ -244,6 +262,6 @@
   test_extended_slot<void>();
   test_extended_slot<int>();
   test_reference_args();
-
+ test_typedefs_etc();
   return 0;
 }

Modified: trunk/libs/signals2/test/slot_compile_test.cpp
==============================================================================
--- trunk/libs/signals2/test/slot_compile_test.cpp (original)
+++ trunk/libs/signals2/test/slot_compile_test.cpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -23,6 +23,5 @@
 int test_main(int, char*[])
 {
   boost::signals2::slot<void (void)> sl0(&myslot);
- boost::signals2::slot1<int, int> sl2(&myslot2);
   return 0;
 }

Modified: trunk/libs/signals2/test/track_test.cpp
==============================================================================
--- trunk/libs/signals2/test/track_test.cpp (original)
+++ trunk/libs/signals2/test/track_test.cpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -53,7 +53,7 @@
 
 int test_main(int, char*[])
 {
- typedef boost::signals2::signal1<int, int, max_or_default<int> > sig_type;
+ typedef boost::signals2::signal<int (int), max_or_default<int> > sig_type;
   sig_type s1;
   boost::signals2::connection connection;
 

Modified: trunk/libs/signals2/test/trackable_test.cpp
==============================================================================
--- trunk/libs/signals2/test/trackable_test.cpp (original)
+++ trunk/libs/signals2/test/trackable_test.cpp 2009-05-28 14:49:27 EDT (Thu, 28 May 2009)
@@ -47,7 +47,7 @@
 
 int test_main(int, char*[])
 {
- typedef boost::signals2::signal1<int, int, max_or_default<int> > sig_type;
+ typedef boost::signals2::signal<int (int), max_or_default<int> > sig_type;
   sig_type s1;
 
   // Test auto-disconnection
@@ -65,7 +65,7 @@
     BOOST_CHECK(s1(5) == 5);
   }
   BOOST_CHECK(s1(5) == 0);
-
+
   // Test multiple arg slot constructor
   {
     short_lived shorty;


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