Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53390 - in trunk/boost/signals2: . detail
From: fmhess_at_[hidden]
Date: 2009-05-29 09:34:44


Author: fmhess
Date: 2009-05-29 09:34:42 EDT (Fri, 29 May 2009)
New Revision: 53390
URL: http://svn.boost.org/trac/boost/changeset/53390

Log:
Fixed some test errors caused by sig_type::slot_type::signature_type not existing.
Replaced unneeded vararg_count with sizeof...().

Text files modified:
   trunk/boost/signals2/detail/signal_template.hpp | 4 ++--
   trunk/boost/signals2/detail/signals_common_macros.hpp | 4 ++++
   trunk/boost/signals2/detail/slot_template.hpp | 5 +++--
   trunk/boost/signals2/detail/variadic_arg_type.hpp | 16 ----------------
   trunk/boost/signals2/preprocessed_signal.hpp | 1 -
   trunk/boost/signals2/preprocessed_slot.hpp | 1 -
   trunk/boost/signals2/signal.hpp | 1 +
   trunk/boost/signals2/slot.hpp | 1 +
   trunk/boost/signals2/variadic_signal.hpp | 1 -
   trunk/boost/signals2/variadic_slot.hpp | 1 -
   10 files changed, 11 insertions(+), 24 deletions(-)

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-29 09:34:42 EDT (Fri, 29 May 2009)
@@ -534,6 +534,7 @@
       typedef GroupCompare group_compare_type;
       typedef typename impl_class::slot_call_iterator
         slot_call_iterator;
+ typedef typename mpl::identity<BOOST_SIGNALS2_SIGNATURE_FUNCTION_TYPE(BOOST_SIGNALS2_NUM_ARGS)>::type signature_type;
 
 #ifdef BOOST_NO_VARIADIC_TEMPLATES
 
@@ -564,8 +565,7 @@
       public:
         typedef typename detail::variadic_arg_type<n, Args...>::type type;
       };
- BOOST_STATIC_CONSTANT(int, arity = detail::vararg_count<Args...>::value);
- typedef typename mpl::identity<R (Args...)>::type signature_type;
+ BOOST_STATIC_CONSTANT(int, arity = sizeof...(Args));
 
 #endif // BOOST_NO_VARIADIC_TEMPLATES
 

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-29 09:34:42 EDT (Fri, 29 May 2009)
@@ -38,6 +38,9 @@
 // T1, T2, ..., TN
 #define BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(arity) \
   BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), T)
+// R (T1, T2, ..., TN)
+#define BOOST_SIGNALS2_SIGNATURE_FUNCTION_TYPE(arity) \
+ R ( BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(arity) )
 // 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) \
@@ -132,6 +135,7 @@
 #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_SIGNATURE_FUNCTION_TYPE(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

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-29 09:34:42 EDT (Fri, 29 May 2009)
@@ -39,6 +39,8 @@
 
       typedef SlotFunction slot_function_type;
       typedef R result_type;
+ typedef typename mpl::identity<BOOST_SIGNALS2_SIGNATURE_FUNCTION_TYPE(BOOST_SIGNALS2_NUM_ARGS)>::type signature_type;
+
 #ifdef BOOST_NO_VARIADIC_TEMPLATES
 
 // typedef Tn argn_type;
@@ -68,8 +70,7 @@
       public:
         typedef typename detail::variadic_arg_type<n, Args...>::type type;
       };
- BOOST_STATIC_CONSTANT(int, arity = detail::vararg_count<Args...>::value);
- typedef typename mpl::identity<R (Args...)>::type signature_type;
+ BOOST_STATIC_CONSTANT(int, arity = sizeof...(Args));
 
 #endif // BOOST_NO_VARIADIC_TEMPLATES
 

Modified: trunk/boost/signals2/detail/variadic_arg_type.hpp
==============================================================================
--- trunk/boost/signals2/detail/variadic_arg_type.hpp (original)
+++ trunk/boost/signals2/detail/variadic_arg_type.hpp 2009-05-29 09:34:42 EDT (Fri, 29 May 2009)
@@ -29,22 +29,6 @@
       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

Modified: trunk/boost/signals2/preprocessed_signal.hpp
==============================================================================
--- trunk/boost/signals2/preprocessed_signal.hpp (original)
+++ trunk/boost/signals2/preprocessed_signal.hpp 2009-05-29 09:34:42 EDT (Fri, 29 May 2009)
@@ -43,7 +43,6 @@
       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)
       {}

Modified: trunk/boost/signals2/preprocessed_slot.hpp
==============================================================================
--- trunk/boost/signals2/preprocessed_slot.hpp (original)
+++ trunk/boost/signals2/preprocessed_slot.hpp 2009-05-29 09:34:42 EDT (Fri, 29 May 2009)
@@ -53,7 +53,6 @@
       typedef typename detail::slotN<boost::function_traits<Signature>::arity,
         Signature, SlotFunction>::type base_type;
     public:
- typedef Signature signature_type;
       template<typename F>
       slot(const F& f): base_type(f)
       {}

Modified: trunk/boost/signals2/signal.hpp
==============================================================================
--- trunk/boost/signals2/signal.hpp (original)
+++ trunk/boost/signals2/signal.hpp 2009-05-29 09:34:42 EDT (Fri, 29 May 2009)
@@ -16,6 +16,7 @@
 #include <boost/assert.hpp>
 #include <boost/config.hpp>
 #include <boost/function.hpp>
+#include <boost/mpl/identity.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/signals2/connection.hpp>
 #include <boost/signals2/detail/unique_lock.hpp>

Modified: trunk/boost/signals2/slot.hpp
==============================================================================
--- trunk/boost/signals2/slot.hpp (original)
+++ trunk/boost/signals2/slot.hpp 2009-05-29 09:34:42 EDT (Fri, 29 May 2009)
@@ -15,6 +15,7 @@
 #include <boost/bind.hpp>
 #include <boost/config.hpp>
 #include <boost/function.hpp>
+#include <boost/mpl/identity.hpp>
 #include <boost/ref.hpp>
 #include <boost/signals2/detail/signals_common.hpp>
 #include <boost/signals2/detail/signals_common_macros.hpp>

Modified: trunk/boost/signals2/variadic_signal.hpp
==============================================================================
--- trunk/boost/signals2/variadic_signal.hpp (original)
+++ trunk/boost/signals2/variadic_signal.hpp 2009-05-29 09:34:42 EDT (Fri, 29 May 2009)
@@ -16,7 +16,6 @@
 #ifndef BOOST_SIGNALS2_VARIADIC_SIGNAL_HPP
 #define BOOST_SIGNALS2_VARIADIC_SIGNAL_HPP
 
-#include <boost/mpl/identity.hpp>
 #include <boost/signals2/detail/variadic_arg_type.hpp>
 #include <boost/signals2/detail/variadic_slot_invoker.hpp>
 #include <boost/type_traits/function_traits.hpp>

Modified: trunk/boost/signals2/variadic_slot.hpp
==============================================================================
--- trunk/boost/signals2/variadic_slot.hpp (original)
+++ trunk/boost/signals2/variadic_slot.hpp 2009-05-29 09:34:42 EDT (Fri, 29 May 2009)
@@ -11,7 +11,6 @@
 #ifndef BOOST_SIGNALS2_VARIADIC_SLOT_HPP
 #define BOOST_SIGNALS2_VARIADIC_SLOT_HPP
 
-#include <boost/mpl/identity.hpp>
 #include <boost/signals2/detail/variadic_arg_type.hpp>
 
 #define BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTORS \


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