Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84007 - in trunk: boost/signals2 boost/signals2/detail libs/signals2/doc/reference
From: fmhess_at_[hidden]
Date: 2013-04-21 23:51:30


Author: fmhess
Date: 2013-04-21 23:51:29 EDT (Sun, 21 Apr 2013)
New Revision: 84007
URL: http://svn.boost.org/trac/boost/changeset/84007

Log:
Tweaked template declaration of swap for signal classes, to make
it more consistent.

Text files modified:
   trunk/boost/signals2/detail/signal_template.hpp | 6 ++++--
   trunk/boost/signals2/preprocessed_signal.hpp | 15 ---------------
   trunk/boost/signals2/signal.hpp | 21 +++++++++++++++++++++
   trunk/libs/signals2/doc/reference/signal_header.xml | 7 +++----
   4 files changed, 28 insertions(+), 21 deletions(-)

Modified: trunk/boost/signals2/detail/signal_template.hpp
==============================================================================
--- trunk/boost/signals2/detail/signal_template.hpp (original)
+++ trunk/boost/signals2/detail/signal_template.hpp 2013-04-21 23:51:29 EDT (Sun, 21 Apr 2013)
@@ -729,14 +729,16 @@
         _pimpl;
     };
 
- // free swap function, findable by ADL
- template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+ // free swap function for signalN classes, findable by ADL
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
       void swap(
         BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS) <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> &sig1,
         BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS) <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> &sig2 )
     {
       sig1.swap(sig2);
     };
+#endif
 
     namespace detail
     {

Modified: trunk/boost/signals2/preprocessed_signal.hpp
==============================================================================
--- trunk/boost/signals2/preprocessed_signal.hpp (original)
+++ trunk/boost/signals2/preprocessed_signal.hpp 2013-04-21 23:51:29 EDT (Sun, 21 Apr 2013)
@@ -49,21 +49,6 @@
         base_type(combiner_arg, group_compare)
       {}
     };
-
- // free swap function, findable by ADL
- template<typename Signature,
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction,
- typename ExtendedSlotFunction,
- typename Mutex>
- void swap(
- signal<Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex> &sig1,
- signal<Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex> &sig2)
- {
- sig1.swap(sig2);
- };
   }
 }
 

Modified: trunk/boost/signals2/signal.hpp
==============================================================================
--- trunk/boost/signals2/signal.hpp (original)
+++ trunk/boost/signals2/signal.hpp 2013-04-21 23:51:29 EDT (Sun, 21 Apr 2013)
@@ -38,4 +38,25 @@
 #include <boost/signals2/variadic_signal.hpp>
 #endif
 
+namespace boost
+{
+ namespace signals2
+ {
+ // free swap function, findable by ADL
+ template<typename Signature,
+ typename Combiner,
+ typename Group,
+ typename GroupCompare,
+ typename SlotFunction,
+ typename ExtendedSlotFunction,
+ typename Mutex>
+ void swap(
+ signal<Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex> &sig1,
+ signal<Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex> &sig2)
+ {
+ sig1.swap(sig2);
+ };
+ }
+}
+
 #endif // BOOST_SIGNALS2_SIGNAL_HPP

Modified: trunk/libs/signals2/doc/reference/signal_header.xml
==============================================================================
--- trunk/libs/signals2/doc/reference/signal_header.xml (original)
+++ trunk/libs/signals2/doc/reference/signal_header.xml 2013-04-21 23:51:29 EDT (Sun, 21 Apr 2013)
@@ -415,21 +415,20 @@
         <free-function-group name="specialized algorithms">
           <function name="swap">
             <template>
+ <template-type-parameter name="Signature"/>
               <template-type-parameter name="Combiner"/>
               <template-type-parameter name="Group"/>
               <template-type-parameter name="GroupCompare"/>
               <template-type-parameter name="SlotFunction"/>
               <template-type-parameter name="ExtendedSlotFunction"/>
               <template-type-parameter name="Mutex"/>
- <template-type-parameter name="R"/>
- <template-type-parameter name="Args..."/>
             </template>
             <type>void</type>
             <parameter name="x">
- <paramtype><classname alt="signals2::signal">signal</classname>&lt;R (Args...), Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex&gt;&amp;</paramtype>
+ <paramtype><classname alt="signals2::signal">signal</classname>&lt;Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex&gt;&amp;</paramtype>
             </parameter>
             <parameter name="y">
- <paramtype><classname alt="signals2::signal">signal</classname>&lt;R (Args...), Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex&gt;&amp;</paramtype>
+ <paramtype><classname alt="signals2::signal">signal</classname>&lt;Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex&gt;&amp;</paramtype>
             </parameter>
 
             <effects><para><computeroutput>x.swap(y)</computeroutput></para></effects>


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