]> git.tdb.fi Git - ext/sigc++-2.0.git/blob - untracked/sigc++/signal.h
Import libsigc++ 2.10.8 sources
[ext/sigc++-2.0.git] / untracked / sigc++ / signal.h
1 // -*- c++ -*-
2 /* Do not edit! -- generated file */
3
4 #ifndef _SIGC_SIGNAL_H_
5 #define _SIGC_SIGNAL_H_
6
7 #include <list>
8 #include <sigc++/signal_base.h>
9 #include <sigc++/type_traits.h>
10 #include <sigc++/trackable.h>
11 #include <sigc++/functors/slot.h>
12 #include <sigc++/functors/mem_fun.h>
13
14 //TODO: See comment in functor_trait.h.
15 #if defined(nil) && defined(SIGC_PRAGMA_PUSH_POP_MACRO)
16   #define SIGC_NIL_HAS_BEEN_PUSHED 1
17   #pragma push_macro("nil")
18   #undef nil
19 #endif
20
21 //SIGC_TYPEDEF_REDEFINE_ALLOWED:
22 // TODO: This should have its own test, but I can not create one that gives the error instead of just a warning. murrayc.
23 // I have just used this because there is a correlation between these two problems.
24 #ifdef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
25   //Compilers, such as older versions of SUN Forte C++, that do not allow this also often
26   //do not allow a typedef to have the same name as a class in the typedef's definition.
27   //For Sun Forte CC 5.7 (SUN Workshop 10), comment this out to fix the build.
28   #define SIGC_TYPEDEF_REDEFINE_ALLOWED 1
29 #endif
30
31 namespace sigc {
32
33 /** STL-style iterator for slot_list.
34  *
35  * @ingroup signal
36  */
37 template <typename T_slot>
38 struct slot_iterator
39 {
40   typedef std::size_t                     size_type;
41   typedef std::ptrdiff_t                  difference_type;
42   typedef std::bidirectional_iterator_tag iterator_category;
43
44   typedef T_slot  slot_type;
45
46   typedef T_slot  value_type;
47   typedef T_slot* pointer;
48   typedef T_slot& reference;
49
50   typedef typename internal::signal_impl::iterator_type iterator_type;
51
52   slot_iterator()
53     {}
54
55   explicit slot_iterator(const iterator_type& i)
56     : i_(i) {}
57
58   reference operator*() const
59     { return static_cast<reference>(*i_); }
60
61   pointer operator->() const
62     { return &(operator*()); }
63
64   slot_iterator& operator++()
65     {
66       ++i_;
67       return *this;
68     }
69
70   slot_iterator operator++(int)
71     { 
72       slot_iterator __tmp(*this);
73       ++i_;
74       return __tmp;
75     }
76
77   slot_iterator& operator--()
78     {
79       --i_;
80       return *this;
81     }
82
83   slot_iterator operator--(int)
84     {
85       slot_iterator __tmp(*this);
86       --i_;
87       return __tmp;
88     }
89
90   bool operator == (const slot_iterator& other) const
91     { return i_ == other.i_; }
92
93   bool operator != (const slot_iterator& other) const
94     { return i_ != other.i_; }
95
96   iterator_type i_;
97 };
98
99 /** STL-style const iterator for slot_list.
100  *
101  * @ingroup signal
102  */
103 template <typename T_slot>
104 struct slot_const_iterator
105 {
106   typedef std::size_t                     size_type;
107   typedef std::ptrdiff_t                  difference_type;
108   typedef std::bidirectional_iterator_tag iterator_category;
109
110   typedef T_slot        slot_type;
111
112   typedef T_slot        value_type;
113   typedef const T_slot* pointer;
114   typedef const T_slot& reference;
115
116   typedef typename internal::signal_impl::const_iterator_type iterator_type;
117
118   slot_const_iterator()
119     {}
120
121   explicit slot_const_iterator(const iterator_type& i)
122     : i_(i) {}
123
124   reference operator*() const
125     { return static_cast<reference>(*i_); }
126
127   pointer operator->() const
128     { return &(operator*()); }
129
130   slot_const_iterator& operator++()
131     {
132       ++i_;
133       return *this;
134     }
135
136   slot_const_iterator operator++(int)
137     { 
138       slot_const_iterator __tmp(*this);
139       ++i_;
140       return __tmp;
141     }
142
143   slot_const_iterator& operator--()
144     {
145       --i_;
146       return *this;
147     }
148
149   slot_const_iterator operator--(int)
150     {
151       slot_const_iterator __tmp(*this);
152       --i_;
153       return __tmp;
154     }
155
156   bool operator == (const slot_const_iterator& other) const
157     { return i_ == other.i_; }
158
159   bool operator != (const slot_const_iterator& other) const
160     { return i_ != other.i_; }
161
162   iterator_type i_;
163 };
164
165 /** STL-style list interface for sigc::signal#.
166  * slot_list can be used to iterate over the list of slots that
167  * is managed by a signal. Slots can be added or removed from
168  * the list while existing iterators stay valid.
169  *
170  * @ingroup signal
171  */
172 template <class T_slot>
173 struct slot_list
174 {
175   typedef T_slot slot_type;
176
177   typedef slot_type&       reference;
178   typedef const slot_type& const_reference;
179
180   typedef slot_iterator<slot_type>              iterator;
181   typedef slot_const_iterator<slot_type>        const_iterator;
182   
183   #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
184   typedef std::reverse_iterator<iterator>       reverse_iterator;
185   typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
186   #else
187   typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
188                                 int, int&, int*, std::ptrdiff_t> reverse_iterator;
189
190   typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
191                                 int, const int&, const int*, std::ptrdiff_t> const_reverse_iterator;
192   #endif /* SIGC_HAVE_SUN_REVERSE_ITERATOR */
193
194
195   slot_list()
196     : list_(nullptr) {}
197
198   explicit slot_list(internal::signal_impl* __list)
199     : list_(__list) {}
200
201   iterator begin()
202     { return iterator(list_->slots_.begin()); }
203
204   const_iterator begin() const
205     { return const_iterator(list_->slots_.begin()); }
206
207   iterator end()
208     { return iterator(list_->slots_.end()); }
209
210   const_iterator end() const
211     { return const_iterator(list_->slots_.end()); }
212
213   reverse_iterator rbegin() 
214     { return reverse_iterator(end()); }
215
216   const_reverse_iterator rbegin() const 
217     { return const_reverse_iterator(end()); }
218
219   reverse_iterator rend()
220     { return reverse_iterator(begin()); }
221
222   const_reverse_iterator rend() const
223     { return const_reverse_iterator(begin()); }
224
225   reference front()
226     { return *begin(); }
227
228   const_reference front() const
229     { return *begin(); }
230
231   reference back()
232     { return *(--end()); }
233
234   const_reference back() const
235     { return *(--end()); }
236
237   iterator insert(iterator i, const slot_type& slot_)
238     { return iterator(list_->insert(i.i_, static_cast<const slot_base&>(slot_))); }
239
240   iterator insert(iterator i, slot_type&& slot_)
241     { return iterator(list_->insert(i.i_, std::move(static_cast<slot_base&>(slot_)))); }
242
243   void push_front(const slot_type& c)
244     { insert(begin(), c); }
245
246   void push_front(slot_type&& c)
247     { insert(begin(), std::move(c)); }
248
249   void push_back(const slot_type& c)
250     { insert(end(), c); }
251
252   void push_back(slot_type&& c)
253     { insert(end(), std::move(c)); }
254
255   iterator erase(iterator i)
256     { return iterator(list_->erase(i.i_)); }
257
258   iterator erase(iterator first_, iterator last_)
259     {
260       while (first_ != last_)
261         first_ = erase(first_);
262       return last_;
263     }
264
265   void pop_front()
266     { erase(begin()); }
267
268   void pop_back()
269     { 
270       auto tmp_ = end();
271       erase(--tmp_);
272     }
273
274 protected:
275   internal::signal_impl* list_;
276 };
277
278
279 namespace internal {
280
281 /** Special iterator over sigc::internal::signal_impl's slot list that holds extra data.
282  * This iterators is for use in accumulators. operator*() executes
283  * the slot. The return value is buffered, so that in an expression
284  * like @code a = (*i) * (*i); @endcode the slot is executed only once.
285  */
286 template <class T_emitter, class T_result = typename T_emitter::result_type>
287 struct slot_iterator_buf
288 {
289   typedef std::size_t                      size_type;
290   typedef std::ptrdiff_t                   difference_type;
291   typedef std::bidirectional_iterator_tag  iterator_category;
292
293   //These are needed just to make this a proper C++ iterator, 
294   //that can be used with standard C++ algorithms.
295   typedef T_result                         value_type;
296   typedef T_result&                        reference;
297   typedef T_result*                        pointer;
298
299   typedef T_emitter                        emitter_type;
300   typedef T_result                         result_type;
301   typedef typename T_emitter::slot_type    slot_type;
302
303   typedef signal_impl::const_iterator_type iterator_type;
304
305   slot_iterator_buf()
306     : c_(nullptr), invoked_(false) {}
307
308   slot_iterator_buf(const iterator_type& i, const emitter_type* c)
309     : i_(i), c_(c), invoked_(false) {}
310
311   result_type operator*() const
312     {
313       if (!i_->empty() && !i_->blocked() && !invoked_)
314         {
315           r_ = (*c_)(static_cast<const slot_type&>(*i_));
316           invoked_ = true;
317         }
318       return r_;
319     }
320
321   slot_iterator_buf& operator++()
322     {
323       ++i_;
324       invoked_ = false;
325       return *this;
326     }
327
328   slot_iterator_buf operator++(int)
329     { 
330       slot_iterator_buf __tmp(*this);
331       ++i_;
332       invoked_ = false;
333       return __tmp;
334     }
335
336   slot_iterator_buf& operator--()
337     {
338       --i_;
339       invoked_ = false;
340       return *this;
341     }
342
343   slot_iterator_buf operator--(int)
344     {
345       slot_iterator_buf __tmp(*this);
346       --i_;
347       invoked_ = false;
348       return __tmp;
349     }
350
351   bool operator == (const slot_iterator_buf& other) const
352     { return (!c_ || (i_ == other.i_)); } /* If '!c_' the iterators are empty.
353                                            * Unfortunately, empty stl iterators are not equal.
354                                            * We are forcing equality so that 'first==last'
355                                            * in the accumulator's emit function yields true. */
356
357   bool operator != (const slot_iterator_buf& other) const
358     { return (c_ && (i_ != other.i_)); }
359
360 private:
361   iterator_type i_;
362   const emitter_type* c_;
363   mutable result_type r_;
364   mutable bool invoked_;
365 };
366
367 /** Template specialization of slot_iterator_buf for void return signals.
368  */
369 template <class T_emitter>
370 struct slot_iterator_buf<T_emitter, void>
371 {
372   typedef std::size_t                      size_type;
373   typedef std::ptrdiff_t                   difference_type;
374   typedef std::bidirectional_iterator_tag  iterator_category;
375
376   typedef T_emitter                        emitter_type;
377   typedef void                             result_type;
378   typedef typename T_emitter::slot_type    slot_type;
379
380   typedef signal_impl::const_iterator_type iterator_type;
381
382   slot_iterator_buf()
383     : c_(nullptr), invoked_(false) {}
384
385   slot_iterator_buf(const iterator_type& i, const emitter_type* c)
386     : i_(i), c_(c), invoked_(false) {}
387
388   void operator*() const
389     {
390       if (!i_->empty() && !i_->blocked() && !invoked_)
391         {
392           (*c_)(static_cast<const slot_type&>(*i_));
393           invoked_ = true;
394         }
395     }
396
397   slot_iterator_buf& operator++()
398     {
399       ++i_;
400       invoked_ = false;
401       return *this;
402     }
403
404   slot_iterator_buf operator++(int)
405     { 
406       slot_iterator_buf __tmp(*this);
407       ++i_;
408       invoked_ = false;
409       return __tmp;
410     }
411
412   slot_iterator_buf& operator--()
413     {
414       --i_;
415       invoked_ = false;
416       return *this;
417     }
418
419   slot_iterator_buf operator--(int)
420     {
421       slot_iterator_buf __tmp(*this);
422       --i_;
423       invoked_ = false;
424       return __tmp;
425     }
426
427   bool operator == (const slot_iterator_buf& other) const
428     { return i_ == other.i_; }
429
430   bool operator != (const slot_iterator_buf& other) const
431     { return i_ != other.i_; }
432
433 private:
434   iterator_type i_;
435   const emitter_type* c_;
436   mutable bool invoked_;
437 };
438
439 /** Reverse version of sigc::internal::slot_iterator_buf. */
440 template <class T_emitter, class T_result = typename T_emitter::result_type>
441 struct slot_reverse_iterator_buf
442 {
443   typedef std::size_t                      size_type;
444   typedef std::ptrdiff_t                   difference_type;
445   typedef std::bidirectional_iterator_tag  iterator_category;
446
447   //These are needed just to make this a proper C++ iterator, 
448   //that can be used with standard C++ algorithms.
449   typedef T_result                         value_type;
450   typedef T_result&                        reference;
451   typedef T_result*                        pointer;
452
453   typedef T_emitter                        emitter_type;
454   typedef T_result                         result_type;
455   typedef typename T_emitter::slot_type    slot_type;
456
457   typedef signal_impl::const_iterator_type iterator_type;
458
459   slot_reverse_iterator_buf()
460     : c_(nullptr), invoked_(false) {}
461
462   slot_reverse_iterator_buf(const iterator_type& i, const emitter_type* c)
463     : i_(i), c_(c), invoked_(false) {}
464
465   result_type operator*() const
466     {
467       auto __tmp(i_);
468           --__tmp;
469       if (!__tmp->empty() && !__tmp->blocked() && !invoked_)
470         {
471           r_ = (*c_)(static_cast<const slot_type&>(*__tmp));
472           invoked_ = true;
473         }
474       return r_;
475     }
476
477   slot_reverse_iterator_buf& operator++()
478     {
479       --i_;
480       invoked_ = false;
481       return *this;
482     }
483
484   slot_reverse_iterator_buf operator++(int)
485     { 
486       slot_reverse_iterator_buf __tmp(*this);
487       --i_;
488       invoked_ = false;
489       return __tmp;
490     }
491
492   slot_reverse_iterator_buf& operator--()
493     {
494       ++i_;
495       invoked_ = false;
496       return *this;
497     }
498
499   slot_reverse_iterator_buf operator--(int)
500     {
501       slot_reverse_iterator_buf __tmp(*this);
502       ++i_;
503       invoked_ = false;
504       return __tmp;
505     }
506
507   bool operator == (const slot_reverse_iterator_buf& other) const
508     { return (!c_ || (i_ == other.i_)); } /* If '!c_' the iterators are empty.
509                                            * Unfortunately, empty stl iterators are not equal.
510                                            * We are forcing equality so that 'first==last'
511                                            * in the accumulator's emit function yields true. */
512
513   bool operator != (const slot_reverse_iterator_buf& other) const
514     { return (c_ && (i_ != other.i_)); }
515
516 private:
517   iterator_type i_;
518   const emitter_type* c_;
519   mutable result_type r_;
520   mutable bool invoked_;
521 };
522
523 /** Template specialization of slot_reverse_iterator_buf for void return signals.
524  */
525 template <class T_emitter>
526 struct slot_reverse_iterator_buf<T_emitter, void>
527 {
528   typedef std::size_t                      size_type;
529   typedef std::ptrdiff_t                   difference_type;
530   typedef std::bidirectional_iterator_tag  iterator_category;
531
532   typedef T_emitter                        emitter_type;
533   typedef void                             result_type;
534   typedef typename T_emitter::slot_type    slot_type;
535
536   typedef signal_impl::const_iterator_type iterator_type;
537
538   slot_reverse_iterator_buf()
539     : c_(nullptr), invoked_(false) {}
540
541   slot_reverse_iterator_buf(const iterator_type& i, const emitter_type* c)
542     : i_(i), c_(c), invoked_(false) {}
543
544   void operator*() const
545     {
546       auto __tmp(i_);
547           --__tmp;
548           if (!__tmp->empty() && !__tmp->blocked() && !invoked_)
549         {
550           (*c_)(static_cast<const slot_type&>(*__tmp));
551           invoked_ = true;
552         }
553     }
554
555   slot_reverse_iterator_buf& operator++()
556     {
557       --i_;
558       invoked_ = false;
559       return *this;
560     }
561
562   slot_reverse_iterator_buf operator++(int)
563     { 
564       slot_reverse_iterator_buf __tmp(*this);
565       --i_;
566       invoked_ = false;
567       return __tmp;
568     }
569
570   slot_reverse_iterator_buf& operator--()
571     {
572       ++i_;
573       invoked_ = false;
574       return *this;
575     }
576
577   slot_reverse_iterator_buf operator--(int)
578     {
579       slot_reverse_iterator_buf __tmp(*this);
580       ++i_;
581       invoked_ = false;
582       return __tmp;
583     }
584
585   bool operator == (const slot_reverse_iterator_buf& other) const
586     { return i_ == other.i_; }
587
588   bool operator != (const slot_reverse_iterator_buf& other) const
589     { return i_ != other.i_; }
590
591 private:
592   iterator_type i_;
593   const emitter_type* c_;
594   mutable bool invoked_;
595 };
596
597 /** Abstracts signal emission.
598  * This template implements the emit() function of signal0.
599  * Template specializations are available to optimize signal
600  * emission when no accumulator is used, for example when the template
601  * argument @e T_accumulator is @p nil.
602  */
603 template <class T_return, class T_accumulator>
604 struct signal_emit0
605 {
606   typedef signal_emit0<T_return, T_accumulator> self_type;
607   typedef typename T_accumulator::result_type result_type;
608   typedef slot<T_return()> slot_type;
609   typedef internal::slot_iterator_buf<self_type, T_return> slot_iterator_buf_type;
610   typedef internal::slot_reverse_iterator_buf<self_type, T_return> slot_reverse_iterator_buf_type;
611   typedef signal_impl::const_iterator_type iterator_type;
612
613   signal_emit0()  {}
614
615   /** Invokes a slot.
616    * @param _A_slot Some slot to invoke.
617    * @return The slot's return value.
618    */
619   T_return operator()(const slot_type& _A_slot) const
620     { return (sigc::internal::function_pointer_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_); }
621
622   /** Executes a list of slots using an accumulator of type @e T_accumulator.
623
624    * @return The accumulated return values of the slot invocations as processed by the accumulator.
625    */
626   static result_type emit(signal_impl* impl)
627     {
628       T_accumulator accumulator;
629
630       if (!impl)
631         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
632
633       signal_exec exec(impl);
634       temp_slot_list slots(impl->slots_);
635
636       self_type self ;
637       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
638                          slot_iterator_buf_type(slots.end(), &self));
639     }
640
641 #ifndef SIGCXX_DISABLE_DEPRECATED
642   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
643
644    * @return The accumulated return values of the slot invocations as processed by the accumulator.
645    *
646    * @deprecated This is apparently not useful, but please let us know if you need it.
647    */
648   static result_type emit_reverse(signal_impl* impl)
649     {
650       T_accumulator accumulator;
651
652       if (!impl)
653         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
654
655       signal_exec exec(impl);
656       temp_slot_list slots(impl->slots_);
657
658       self_type self ;
659       return accumulator(slot_reverse_iterator_buf_type(slots.end(), &self),
660                          slot_reverse_iterator_buf_type(slots.begin(), &self));
661     }
662 #endif // SIGCXX_DISABLE_DEPRECATED
663
664   
665 };
666
667 /** Abstracts signal emission.
668  * This template specialization implements an optimized emit()
669  * function for the case that no accumulator is used.
670  */
671 template <class T_return>
672 struct signal_emit0<T_return, nil>
673 {
674   typedef signal_emit0<T_return, nil > self_type;
675   typedef T_return result_type;
676   typedef slot<T_return()> slot_type;
677   typedef signal_impl::const_iterator_type iterator_type;
678   typedef typename slot_type::call_type call_type;
679
680   /** Executes a list of slots using an accumulator of type @e T_accumulator.
681    * The return value of the last slot invoked is returned.
682    * @param first An iterator pointing to the first slot in the list.
683    * @param last An iterator pointing to the last slot in the list.
684    * @return The return value of the last slot invoked.
685    */
686   static result_type emit(signal_impl* impl)
687     {
688       if (!impl || impl->slots_.empty())
689         return T_return();
690         
691       signal_exec exec(impl);
692       T_return r_ = T_return(); 
693       
694       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
695       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
696       { 
697         temp_slot_list slots(impl->slots_);
698         auto it = slots.begin();
699         for (; it != slots.end(); ++it)
700           if (!it->empty() && !it->blocked()) break;
701           
702         if (it == slots.end())
703           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
704   
705         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_);
706         for (++it; it != slots.end(); ++it)
707           {
708             if (it->empty() || it->blocked())
709               continue;
710             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_);
711           }
712       }
713       
714       return r_;
715     }
716
717 #ifndef SIGCXX_DISABLE_DEPRECATED
718   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
719    * The return value of the last slot invoked is returned.
720    * @param first An iterator pointing to the first slot in the list.
721    * @param last An iterator pointing to the last slot in the list.
722    * @return The return value of the last slot invoked.
723    *
724    * @deprecated This is apparently not useful, but please let us know if you need it.
725    */
726   static result_type emit_reverse(signal_impl* impl)
727     {
728       if (!impl || impl->slots_.empty())
729         return T_return();
730         
731       signal_exec exec(impl);
732       T_return r_ = T_return(); 
733       
734       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
735       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
736       { 
737 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
738         typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
739 #else
740         typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
741                                        slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
742 #endif
743
744         temp_slot_list slots(impl->slots_);
745         reverse_iterator_type it(slots.end());
746         for (; it != reverse_iterator_type(slots.begin()); ++it)
747           if (!it->empty() && !it->blocked()) break;
748           
749         if (it == reverse_iterator_type(slots.begin()))
750           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
751   
752         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_);
753         for (++it; it != reverse_iterator_type(slots.begin()); ++it)
754           {
755             if (it->empty() || it->blocked())
756               continue;
757             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_);
758           }
759       }
760       
761       return r_;
762     }
763 #endif // SIGCXX_DISABLE_DEPRECATED
764 };
765
766 /** Abstracts signal emission.
767  * This template specialization implements an optimized emit()
768  * function for the case that no accumulator is used and the
769  * return type is @p void.
770  */
771 template <>
772 struct signal_emit0<void, nil>
773 {
774   typedef signal_emit0<void, nil> self_type;
775   typedef void result_type;
776   typedef slot<void()> slot_type;
777   typedef signal_impl::const_iterator_type iterator_type;
778   typedef void (*call_type)(slot_rep*);
779
780   /** Executes a list of slots using an accumulator of type @e T_accumulator.
781    * @param first An iterator pointing to the first slot in the list.
782    * @param last An iterator pointing to the last slot in the list.
783    */
784   static result_type emit(signal_impl* impl)
785     {
786       if (!impl || impl->slots_.empty()) return;
787       signal_exec exec(impl);
788       temp_slot_list slots(impl->slots_);
789
790       for (const auto& slot : slots)
791         {
792           if (slot.empty() || slot.blocked())
793             continue;
794           (sigc::internal::function_pointer_cast<call_type>(slot.rep_->call_))(slot.rep_);
795         }
796     }
797
798 #ifndef SIGCXX_DISABLE_DEPRECATED
799   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
800    * @param first An iterator pointing to the first slot in the list.
801    * @param last An iterator pointing to the last slot in the list.
802    *
803    * @deprecated This is apparently not useful, but please let us know if you need it.
804    */
805   static result_type emit_reverse(signal_impl* impl)
806     {
807       if (!impl || impl->slots_.empty()) return;
808       signal_exec exec(impl);
809       temp_slot_list slots(impl->slots_);
810
811 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
812       typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
813 #else
814       typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
815                                      slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
816 #endif
817       for (auto it = reverse_iterator_type(slots.end()); it != reverse_iterator_type(slots.begin()); ++it)
818         {
819           if (it->empty() || it->blocked())
820             continue;
821           (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_);
822         }
823     }
824 #endif // SIGCXX_DISABLE_DEPRECATED
825 };
826
827 /** Abstracts signal emission.
828  * This template implements the emit() function of signal1.
829  * Template specializations are available to optimize signal
830  * emission when no accumulator is used, for example when the template
831  * argument @e T_accumulator is @p nil.
832  */
833 template <class T_return, class T_arg1, class T_accumulator>
834 struct signal_emit1
835 {
836   typedef signal_emit1<T_return, T_arg1, T_accumulator> self_type;
837   typedef typename T_accumulator::result_type result_type;
838   typedef slot<T_return(T_arg1)> slot_type;
839   typedef internal::slot_iterator_buf<self_type, T_return> slot_iterator_buf_type;
840   typedef internal::slot_reverse_iterator_buf<self_type, T_return> slot_reverse_iterator_buf_type;
841   typedef signal_impl::const_iterator_type iterator_type;
842
843   /** Instantiates the class.
844    * The parameters are stored in member variables. operator()() passes
845    * the values on to some slot.
846    */
847   signal_emit1(type_trait_take_t<T_arg1> _A_a1) 
848     : _A_a1_(_A_a1) {}
849
850
851   /** Invokes a slot using the buffered parameter values.
852    * @param _A_slot Some slot to invoke.
853    * @return The slot's return value.
854    */
855   T_return operator()(const slot_type& _A_slot) const
856     { return (sigc::internal::function_pointer_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_, _A_a1_); }
857
858   /** Executes a list of slots using an accumulator of type @e T_accumulator.
859    * The arguments are buffered in a temporary instance of signal_emit1.
860
861    * @param _A_a1 Argument to be passed on to the slots.
862    * @return The accumulated return values of the slot invocations as processed by the accumulator.
863    */
864   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1)
865     {
866       T_accumulator accumulator;
867
868       if (!impl)
869         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
870
871       signal_exec exec(impl);
872       temp_slot_list slots(impl->slots_);
873
874       self_type self (_A_a1);
875       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
876                          slot_iterator_buf_type(slots.end(), &self));
877     }
878
879 #ifndef SIGCXX_DISABLE_DEPRECATED
880   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
881    * The arguments are buffered in a temporary instance of signal_emit1.
882
883    * @param _A_a1 Argument to be passed on to the slots.
884    * @return The accumulated return values of the slot invocations as processed by the accumulator.
885    *
886    * @deprecated This is apparently not useful, but please let us know if you need it.
887    */
888   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1)
889     {
890       T_accumulator accumulator;
891
892       if (!impl)
893         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
894
895       signal_exec exec(impl);
896       temp_slot_list slots(impl->slots_);
897
898       self_type self (_A_a1);
899       return accumulator(slot_reverse_iterator_buf_type(slots.end(), &self),
900                          slot_reverse_iterator_buf_type(slots.begin(), &self));
901     }
902 #endif // SIGCXX_DISABLE_DEPRECATED
903
904   
905   type_trait_take_t<T_arg1> _A_a1_;
906 };
907
908 /** Abstracts signal emission.
909  * This template specialization implements an optimized emit()
910  * function for the case that no accumulator is used.
911  */
912 template <class T_return, class T_arg1>
913 struct signal_emit1<T_return, T_arg1, nil>
914 {
915   typedef signal_emit1<T_return, T_arg1, nil > self_type;
916   typedef T_return result_type;
917   typedef slot<T_return(T_arg1)> slot_type;
918   typedef signal_impl::const_iterator_type iterator_type;
919   typedef typename slot_type::call_type call_type;
920
921   /** Executes a list of slots using an accumulator of type @e T_accumulator.
922    * The arguments are passed directly on to the slots.
923    * The return value of the last slot invoked is returned.
924    * @param first An iterator pointing to the first slot in the list.
925    * @param last An iterator pointing to the last slot in the list.
926    * @param _A_a1 Argument to be passed on to the slots.
927    * @return The return value of the last slot invoked.
928    */
929   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1)
930     {
931       if (!impl || impl->slots_.empty())
932         return T_return();
933         
934       signal_exec exec(impl);
935       T_return r_ = T_return(); 
936       
937       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
938       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
939       { 
940         temp_slot_list slots(impl->slots_);
941         auto it = slots.begin();
942         for (; it != slots.end(); ++it)
943           if (!it->empty() && !it->blocked()) break;
944           
945         if (it == slots.end())
946           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
947   
948         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1);
949         for (++it; it != slots.end(); ++it)
950           {
951             if (it->empty() || it->blocked())
952               continue;
953             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1);
954           }
955       }
956       
957       return r_;
958     }
959
960 #ifndef SIGCXX_DISABLE_DEPRECATED
961   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
962    * The arguments are passed directly on to the slots.
963    * The return value of the last slot invoked is returned.
964    * @param first An iterator pointing to the first slot in the list.
965    * @param last An iterator pointing to the last slot in the list.
966    * @param _A_a1 Argument to be passed on to the slots.
967    * @return The return value of the last slot invoked.
968    *
969    * @deprecated This is apparently not useful, but please let us know if you need it.
970    */
971   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1)
972     {
973       if (!impl || impl->slots_.empty())
974         return T_return();
975         
976       signal_exec exec(impl);
977       T_return r_ = T_return(); 
978       
979       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
980       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
981       { 
982 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
983         typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
984 #else
985         typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
986                                        slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
987 #endif
988
989         temp_slot_list slots(impl->slots_);
990         reverse_iterator_type it(slots.end());
991         for (; it != reverse_iterator_type(slots.begin()); ++it)
992           if (!it->empty() && !it->blocked()) break;
993           
994         if (it == reverse_iterator_type(slots.begin()))
995           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
996   
997         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1);
998         for (++it; it != reverse_iterator_type(slots.begin()); ++it)
999           {
1000             if (it->empty() || it->blocked())
1001               continue;
1002             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1);
1003           }
1004       }
1005       
1006       return r_;
1007     }
1008 #endif // SIGCXX_DISABLE_DEPRECATED
1009 };
1010
1011 /** Abstracts signal emission.
1012  * This template specialization implements an optimized emit()
1013  * function for the case that no accumulator is used and the
1014  * return type is @p void.
1015  */
1016 template <class T_arg1>
1017 struct signal_emit1<void, T_arg1, nil>
1018 {
1019   typedef signal_emit1<void, T_arg1, nil> self_type;
1020   typedef void result_type;
1021   typedef slot<void(T_arg1)> slot_type;
1022   typedef signal_impl::const_iterator_type iterator_type;
1023   typedef typename slot_type::call_type call_type;
1024
1025   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1026    * The arguments are passed directly on to the slots.
1027    * @param first An iterator pointing to the first slot in the list.
1028    * @param last An iterator pointing to the last slot in the list.
1029    * @param _A_a1 Argument to be passed on to the slots.
1030    */
1031   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1)
1032     {
1033       if (!impl || impl->slots_.empty()) return;
1034       signal_exec exec(impl);
1035       temp_slot_list slots(impl->slots_);
1036
1037       for (const auto& slot : slots)
1038         {
1039           if (slot.empty() || slot.blocked())
1040             continue;
1041           (sigc::internal::function_pointer_cast<call_type>(slot.rep_->call_))(slot.rep_, _A_a1);
1042         }
1043     }
1044
1045 #ifndef SIGCXX_DISABLE_DEPRECATED
1046   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
1047    * The arguments are passed directly on to the slots.
1048    * @param first An iterator pointing to the first slot in the list.
1049    * @param last An iterator pointing to the last slot in the list.
1050    * @param _A_a1 Argument to be passed on to the slots.
1051    *
1052    * @deprecated This is apparently not useful, but please let us know if you need it.
1053    */
1054   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1)
1055     {
1056       if (!impl || impl->slots_.empty()) return;
1057       signal_exec exec(impl);
1058       temp_slot_list slots(impl->slots_);
1059
1060 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
1061       typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
1062 #else
1063       typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
1064                                      slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
1065 #endif
1066       for (auto it = reverse_iterator_type(slots.end()); it != reverse_iterator_type(slots.begin()); ++it)
1067         {
1068           if (it->empty() || it->blocked())
1069             continue;
1070           (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1);
1071         }
1072     }
1073 #endif // SIGCXX_DISABLE_DEPRECATED
1074 };
1075
1076 /** Abstracts signal emission.
1077  * This template implements the emit() function of signal2.
1078  * Template specializations are available to optimize signal
1079  * emission when no accumulator is used, for example when the template
1080  * argument @e T_accumulator is @p nil.
1081  */
1082 template <class T_return, class T_arg1, class T_arg2, class T_accumulator>
1083 struct signal_emit2
1084 {
1085   typedef signal_emit2<T_return, T_arg1, T_arg2, T_accumulator> self_type;
1086   typedef typename T_accumulator::result_type result_type;
1087   typedef slot<T_return(T_arg1, T_arg2)> slot_type;
1088   typedef internal::slot_iterator_buf<self_type, T_return> slot_iterator_buf_type;
1089   typedef internal::slot_reverse_iterator_buf<self_type, T_return> slot_reverse_iterator_buf_type;
1090   typedef signal_impl::const_iterator_type iterator_type;
1091
1092   /** Instantiates the class.
1093    * The parameters are stored in member variables. operator()() passes
1094    * the values on to some slot.
1095    */
1096   signal_emit2(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2) 
1097     : _A_a1_(_A_a1), _A_a2_(_A_a2) {}
1098
1099
1100   /** Invokes a slot using the buffered parameter values.
1101    * @param _A_slot Some slot to invoke.
1102    * @return The slot's return value.
1103    */
1104   T_return operator()(const slot_type& _A_slot) const
1105     { return (sigc::internal::function_pointer_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_, _A_a1_, _A_a2_); }
1106
1107   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1108    * The arguments are buffered in a temporary instance of signal_emit2.
1109
1110    * @param _A_a1 Argument to be passed on to the slots.
1111    * @param _A_a2 Argument to be passed on to the slots.
1112    * @return The accumulated return values of the slot invocations as processed by the accumulator.
1113    */
1114   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2)
1115     {
1116       T_accumulator accumulator;
1117
1118       if (!impl)
1119         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1120
1121       signal_exec exec(impl);
1122       temp_slot_list slots(impl->slots_);
1123
1124       self_type self (_A_a1, _A_a2);
1125       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
1126                          slot_iterator_buf_type(slots.end(), &self));
1127     }
1128
1129 #ifndef SIGCXX_DISABLE_DEPRECATED
1130   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
1131    * The arguments are buffered in a temporary instance of signal_emit2.
1132
1133    * @param _A_a1 Argument to be passed on to the slots.
1134    * @param _A_a2 Argument to be passed on to the slots.
1135    * @return The accumulated return values of the slot invocations as processed by the accumulator.
1136    *
1137    * @deprecated This is apparently not useful, but please let us know if you need it.
1138    */
1139   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2)
1140     {
1141       T_accumulator accumulator;
1142
1143       if (!impl)
1144         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1145
1146       signal_exec exec(impl);
1147       temp_slot_list slots(impl->slots_);
1148
1149       self_type self (_A_a1, _A_a2);
1150       return accumulator(slot_reverse_iterator_buf_type(slots.end(), &self),
1151                          slot_reverse_iterator_buf_type(slots.begin(), &self));
1152     }
1153 #endif // SIGCXX_DISABLE_DEPRECATED
1154
1155   
1156   type_trait_take_t<T_arg1> _A_a1_;
1157   type_trait_take_t<T_arg2> _A_a2_;
1158 };
1159
1160 /** Abstracts signal emission.
1161  * This template specialization implements an optimized emit()
1162  * function for the case that no accumulator is used.
1163  */
1164 template <class T_return, class T_arg1, class T_arg2>
1165 struct signal_emit2<T_return, T_arg1, T_arg2, nil>
1166 {
1167   typedef signal_emit2<T_return, T_arg1, T_arg2, nil > self_type;
1168   typedef T_return result_type;
1169   typedef slot<T_return(T_arg1, T_arg2)> slot_type;
1170   typedef signal_impl::const_iterator_type iterator_type;
1171   typedef typename slot_type::call_type call_type;
1172
1173   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1174    * The arguments are passed directly on to the slots.
1175    * The return value of the last slot invoked is returned.
1176    * @param first An iterator pointing to the first slot in the list.
1177    * @param last An iterator pointing to the last slot in the list.
1178    * @param _A_a1 Argument to be passed on to the slots.
1179    * @param _A_a2 Argument to be passed on to the slots.
1180    * @return The return value of the last slot invoked.
1181    */
1182   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2)
1183     {
1184       if (!impl || impl->slots_.empty())
1185         return T_return();
1186         
1187       signal_exec exec(impl);
1188       T_return r_ = T_return(); 
1189       
1190       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
1191       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
1192       { 
1193         temp_slot_list slots(impl->slots_);
1194         auto it = slots.begin();
1195         for (; it != slots.end(); ++it)
1196           if (!it->empty() && !it->blocked()) break;
1197           
1198         if (it == slots.end())
1199           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
1200   
1201         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2);
1202         for (++it; it != slots.end(); ++it)
1203           {
1204             if (it->empty() || it->blocked())
1205               continue;
1206             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2);
1207           }
1208       }
1209       
1210       return r_;
1211     }
1212
1213 #ifndef SIGCXX_DISABLE_DEPRECATED
1214   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
1215    * The arguments are passed directly on to the slots.
1216    * The return value of the last slot invoked is returned.
1217    * @param first An iterator pointing to the first slot in the list.
1218    * @param last An iterator pointing to the last slot in the list.
1219    * @param _A_a1 Argument to be passed on to the slots.
1220    * @param _A_a2 Argument to be passed on to the slots.
1221    * @return The return value of the last slot invoked.
1222    *
1223    * @deprecated This is apparently not useful, but please let us know if you need it.
1224    */
1225   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2)
1226     {
1227       if (!impl || impl->slots_.empty())
1228         return T_return();
1229         
1230       signal_exec exec(impl);
1231       T_return r_ = T_return(); 
1232       
1233       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
1234       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
1235       { 
1236 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
1237         typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
1238 #else
1239         typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
1240                                        slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
1241 #endif
1242
1243         temp_slot_list slots(impl->slots_);
1244         reverse_iterator_type it(slots.end());
1245         for (; it != reverse_iterator_type(slots.begin()); ++it)
1246           if (!it->empty() && !it->blocked()) break;
1247           
1248         if (it == reverse_iterator_type(slots.begin()))
1249           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
1250   
1251         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2);
1252         for (++it; it != reverse_iterator_type(slots.begin()); ++it)
1253           {
1254             if (it->empty() || it->blocked())
1255               continue;
1256             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2);
1257           }
1258       }
1259       
1260       return r_;
1261     }
1262 #endif // SIGCXX_DISABLE_DEPRECATED
1263 };
1264
1265 /** Abstracts signal emission.
1266  * This template specialization implements an optimized emit()
1267  * function for the case that no accumulator is used and the
1268  * return type is @p void.
1269  */
1270 template <class T_arg1, class T_arg2>
1271 struct signal_emit2<void, T_arg1, T_arg2, nil>
1272 {
1273   typedef signal_emit2<void, T_arg1, T_arg2, nil> self_type;
1274   typedef void result_type;
1275   typedef slot<void(T_arg1, T_arg2)> slot_type;
1276   typedef signal_impl::const_iterator_type iterator_type;
1277   typedef typename slot_type::call_type call_type;
1278
1279   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1280    * The arguments are passed directly on to the slots.
1281    * @param first An iterator pointing to the first slot in the list.
1282    * @param last An iterator pointing to the last slot in the list.
1283    * @param _A_a1 Argument to be passed on to the slots.
1284    * @param _A_a2 Argument to be passed on to the slots.
1285    */
1286   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2)
1287     {
1288       if (!impl || impl->slots_.empty()) return;
1289       signal_exec exec(impl);
1290       temp_slot_list slots(impl->slots_);
1291
1292       for (const auto& slot : slots)
1293         {
1294           if (slot.empty() || slot.blocked())
1295             continue;
1296           (sigc::internal::function_pointer_cast<call_type>(slot.rep_->call_))(slot.rep_, _A_a1, _A_a2);
1297         }
1298     }
1299
1300 #ifndef SIGCXX_DISABLE_DEPRECATED
1301   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
1302    * The arguments are passed directly on to the slots.
1303    * @param first An iterator pointing to the first slot in the list.
1304    * @param last An iterator pointing to the last slot in the list.
1305    * @param _A_a1 Argument to be passed on to the slots.
1306    * @param _A_a2 Argument to be passed on to the slots.
1307    *
1308    * @deprecated This is apparently not useful, but please let us know if you need it.
1309    */
1310   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2)
1311     {
1312       if (!impl || impl->slots_.empty()) return;
1313       signal_exec exec(impl);
1314       temp_slot_list slots(impl->slots_);
1315
1316 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
1317       typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
1318 #else
1319       typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
1320                                      slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
1321 #endif
1322       for (auto it = reverse_iterator_type(slots.end()); it != reverse_iterator_type(slots.begin()); ++it)
1323         {
1324           if (it->empty() || it->blocked())
1325             continue;
1326           (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2);
1327         }
1328     }
1329 #endif // SIGCXX_DISABLE_DEPRECATED
1330 };
1331
1332 /** Abstracts signal emission.
1333  * This template implements the emit() function of signal3.
1334  * Template specializations are available to optimize signal
1335  * emission when no accumulator is used, for example when the template
1336  * argument @e T_accumulator is @p nil.
1337  */
1338 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_accumulator>
1339 struct signal_emit3
1340 {
1341   typedef signal_emit3<T_return, T_arg1, T_arg2, T_arg3, T_accumulator> self_type;
1342   typedef typename T_accumulator::result_type result_type;
1343   typedef slot<T_return(T_arg1, T_arg2, T_arg3)> slot_type;
1344   typedef internal::slot_iterator_buf<self_type, T_return> slot_iterator_buf_type;
1345   typedef internal::slot_reverse_iterator_buf<self_type, T_return> slot_reverse_iterator_buf_type;
1346   typedef signal_impl::const_iterator_type iterator_type;
1347
1348   /** Instantiates the class.
1349    * The parameters are stored in member variables. operator()() passes
1350    * the values on to some slot.
1351    */
1352   signal_emit3(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3) 
1353     : _A_a1_(_A_a1), _A_a2_(_A_a2), _A_a3_(_A_a3) {}
1354
1355
1356   /** Invokes a slot using the buffered parameter values.
1357    * @param _A_slot Some slot to invoke.
1358    * @return The slot's return value.
1359    */
1360   T_return operator()(const slot_type& _A_slot) const
1361     { return (sigc::internal::function_pointer_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_, _A_a1_, _A_a2_, _A_a3_); }
1362
1363   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1364    * The arguments are buffered in a temporary instance of signal_emit3.
1365
1366    * @param _A_a1 Argument to be passed on to the slots.
1367    * @param _A_a2 Argument to be passed on to the slots.
1368    * @param _A_a3 Argument to be passed on to the slots.
1369    * @return The accumulated return values of the slot invocations as processed by the accumulator.
1370    */
1371   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3)
1372     {
1373       T_accumulator accumulator;
1374
1375       if (!impl)
1376         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1377
1378       signal_exec exec(impl);
1379       temp_slot_list slots(impl->slots_);
1380
1381       self_type self (_A_a1, _A_a2, _A_a3);
1382       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
1383                          slot_iterator_buf_type(slots.end(), &self));
1384     }
1385
1386 #ifndef SIGCXX_DISABLE_DEPRECATED
1387   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
1388    * The arguments are buffered in a temporary instance of signal_emit3.
1389
1390    * @param _A_a1 Argument to be passed on to the slots.
1391    * @param _A_a2 Argument to be passed on to the slots.
1392    * @param _A_a3 Argument to be passed on to the slots.
1393    * @return The accumulated return values of the slot invocations as processed by the accumulator.
1394    *
1395    * @deprecated This is apparently not useful, but please let us know if you need it.
1396    */
1397   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3)
1398     {
1399       T_accumulator accumulator;
1400
1401       if (!impl)
1402         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1403
1404       signal_exec exec(impl);
1405       temp_slot_list slots(impl->slots_);
1406
1407       self_type self (_A_a1, _A_a2, _A_a3);
1408       return accumulator(slot_reverse_iterator_buf_type(slots.end(), &self),
1409                          slot_reverse_iterator_buf_type(slots.begin(), &self));
1410     }
1411 #endif // SIGCXX_DISABLE_DEPRECATED
1412
1413   
1414   type_trait_take_t<T_arg1> _A_a1_;
1415   type_trait_take_t<T_arg2> _A_a2_;
1416   type_trait_take_t<T_arg3> _A_a3_;
1417 };
1418
1419 /** Abstracts signal emission.
1420  * This template specialization implements an optimized emit()
1421  * function for the case that no accumulator is used.
1422  */
1423 template <class T_return, class T_arg1, class T_arg2, class T_arg3>
1424 struct signal_emit3<T_return, T_arg1, T_arg2, T_arg3, nil>
1425 {
1426   typedef signal_emit3<T_return, T_arg1, T_arg2, T_arg3, nil > self_type;
1427   typedef T_return result_type;
1428   typedef slot<T_return(T_arg1, T_arg2, T_arg3)> slot_type;
1429   typedef signal_impl::const_iterator_type iterator_type;
1430   typedef typename slot_type::call_type call_type;
1431
1432   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1433    * The arguments are passed directly on to the slots.
1434    * The return value of the last slot invoked is returned.
1435    * @param first An iterator pointing to the first slot in the list.
1436    * @param last An iterator pointing to the last slot in the list.
1437    * @param _A_a1 Argument to be passed on to the slots.
1438    * @param _A_a2 Argument to be passed on to the slots.
1439    * @param _A_a3 Argument to be passed on to the slots.
1440    * @return The return value of the last slot invoked.
1441    */
1442   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3)
1443     {
1444       if (!impl || impl->slots_.empty())
1445         return T_return();
1446         
1447       signal_exec exec(impl);
1448       T_return r_ = T_return(); 
1449       
1450       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
1451       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
1452       { 
1453         temp_slot_list slots(impl->slots_);
1454         auto it = slots.begin();
1455         for (; it != slots.end(); ++it)
1456           if (!it->empty() && !it->blocked()) break;
1457           
1458         if (it == slots.end())
1459           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
1460   
1461         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3);
1462         for (++it; it != slots.end(); ++it)
1463           {
1464             if (it->empty() || it->blocked())
1465               continue;
1466             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3);
1467           }
1468       }
1469       
1470       return r_;
1471     }
1472
1473 #ifndef SIGCXX_DISABLE_DEPRECATED
1474   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
1475    * The arguments are passed directly on to the slots.
1476    * The return value of the last slot invoked is returned.
1477    * @param first An iterator pointing to the first slot in the list.
1478    * @param last An iterator pointing to the last slot in the list.
1479    * @param _A_a1 Argument to be passed on to the slots.
1480    * @param _A_a2 Argument to be passed on to the slots.
1481    * @param _A_a3 Argument to be passed on to the slots.
1482    * @return The return value of the last slot invoked.
1483    *
1484    * @deprecated This is apparently not useful, but please let us know if you need it.
1485    */
1486   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3)
1487     {
1488       if (!impl || impl->slots_.empty())
1489         return T_return();
1490         
1491       signal_exec exec(impl);
1492       T_return r_ = T_return(); 
1493       
1494       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
1495       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
1496       { 
1497 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
1498         typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
1499 #else
1500         typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
1501                                        slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
1502 #endif
1503
1504         temp_slot_list slots(impl->slots_);
1505         reverse_iterator_type it(slots.end());
1506         for (; it != reverse_iterator_type(slots.begin()); ++it)
1507           if (!it->empty() && !it->blocked()) break;
1508           
1509         if (it == reverse_iterator_type(slots.begin()))
1510           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
1511   
1512         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3);
1513         for (++it; it != reverse_iterator_type(slots.begin()); ++it)
1514           {
1515             if (it->empty() || it->blocked())
1516               continue;
1517             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3);
1518           }
1519       }
1520       
1521       return r_;
1522     }
1523 #endif // SIGCXX_DISABLE_DEPRECATED
1524 };
1525
1526 /** Abstracts signal emission.
1527  * This template specialization implements an optimized emit()
1528  * function for the case that no accumulator is used and the
1529  * return type is @p void.
1530  */
1531 template <class T_arg1, class T_arg2, class T_arg3>
1532 struct signal_emit3<void, T_arg1, T_arg2, T_arg3, nil>
1533 {
1534   typedef signal_emit3<void, T_arg1, T_arg2, T_arg3, nil> self_type;
1535   typedef void result_type;
1536   typedef slot<void(T_arg1, T_arg2, T_arg3)> slot_type;
1537   typedef signal_impl::const_iterator_type iterator_type;
1538   typedef typename slot_type::call_type call_type;
1539
1540   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1541    * The arguments are passed directly on to the slots.
1542    * @param first An iterator pointing to the first slot in the list.
1543    * @param last An iterator pointing to the last slot in the list.
1544    * @param _A_a1 Argument to be passed on to the slots.
1545    * @param _A_a2 Argument to be passed on to the slots.
1546    * @param _A_a3 Argument to be passed on to the slots.
1547    */
1548   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3)
1549     {
1550       if (!impl || impl->slots_.empty()) return;
1551       signal_exec exec(impl);
1552       temp_slot_list slots(impl->slots_);
1553
1554       for (const auto& slot : slots)
1555         {
1556           if (slot.empty() || slot.blocked())
1557             continue;
1558           (sigc::internal::function_pointer_cast<call_type>(slot.rep_->call_))(slot.rep_, _A_a1, _A_a2, _A_a3);
1559         }
1560     }
1561
1562 #ifndef SIGCXX_DISABLE_DEPRECATED
1563   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
1564    * The arguments are passed directly on to the slots.
1565    * @param first An iterator pointing to the first slot in the list.
1566    * @param last An iterator pointing to the last slot in the list.
1567    * @param _A_a1 Argument to be passed on to the slots.
1568    * @param _A_a2 Argument to be passed on to the slots.
1569    * @param _A_a3 Argument to be passed on to the slots.
1570    *
1571    * @deprecated This is apparently not useful, but please let us know if you need it.
1572    */
1573   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3)
1574     {
1575       if (!impl || impl->slots_.empty()) return;
1576       signal_exec exec(impl);
1577       temp_slot_list slots(impl->slots_);
1578
1579 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
1580       typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
1581 #else
1582       typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
1583                                      slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
1584 #endif
1585       for (auto it = reverse_iterator_type(slots.end()); it != reverse_iterator_type(slots.begin()); ++it)
1586         {
1587           if (it->empty() || it->blocked())
1588             continue;
1589           (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3);
1590         }
1591     }
1592 #endif // SIGCXX_DISABLE_DEPRECATED
1593 };
1594
1595 /** Abstracts signal emission.
1596  * This template implements the emit() function of signal4.
1597  * Template specializations are available to optimize signal
1598  * emission when no accumulator is used, for example when the template
1599  * argument @e T_accumulator is @p nil.
1600  */
1601 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_accumulator>
1602 struct signal_emit4
1603 {
1604   typedef signal_emit4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_accumulator> self_type;
1605   typedef typename T_accumulator::result_type result_type;
1606   typedef slot<T_return(T_arg1, T_arg2, T_arg3, T_arg4)> slot_type;
1607   typedef internal::slot_iterator_buf<self_type, T_return> slot_iterator_buf_type;
1608   typedef internal::slot_reverse_iterator_buf<self_type, T_return> slot_reverse_iterator_buf_type;
1609   typedef signal_impl::const_iterator_type iterator_type;
1610
1611   /** Instantiates the class.
1612    * The parameters are stored in member variables. operator()() passes
1613    * the values on to some slot.
1614    */
1615   signal_emit4(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4) 
1616     : _A_a1_(_A_a1), _A_a2_(_A_a2), _A_a3_(_A_a3), _A_a4_(_A_a4) {}
1617
1618
1619   /** Invokes a slot using the buffered parameter values.
1620    * @param _A_slot Some slot to invoke.
1621    * @return The slot's return value.
1622    */
1623   T_return operator()(const slot_type& _A_slot) const
1624     { return (sigc::internal::function_pointer_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_, _A_a1_, _A_a2_, _A_a3_, _A_a4_); }
1625
1626   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1627    * The arguments are buffered in a temporary instance of signal_emit4.
1628
1629    * @param _A_a1 Argument to be passed on to the slots.
1630    * @param _A_a2 Argument to be passed on to the slots.
1631    * @param _A_a3 Argument to be passed on to the slots.
1632    * @param _A_a4 Argument to be passed on to the slots.
1633    * @return The accumulated return values of the slot invocations as processed by the accumulator.
1634    */
1635   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4)
1636     {
1637       T_accumulator accumulator;
1638
1639       if (!impl)
1640         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1641
1642       signal_exec exec(impl);
1643       temp_slot_list slots(impl->slots_);
1644
1645       self_type self (_A_a1, _A_a2, _A_a3, _A_a4);
1646       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
1647                          slot_iterator_buf_type(slots.end(), &self));
1648     }
1649
1650 #ifndef SIGCXX_DISABLE_DEPRECATED
1651   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
1652    * The arguments are buffered in a temporary instance of signal_emit4.
1653
1654    * @param _A_a1 Argument to be passed on to the slots.
1655    * @param _A_a2 Argument to be passed on to the slots.
1656    * @param _A_a3 Argument to be passed on to the slots.
1657    * @param _A_a4 Argument to be passed on to the slots.
1658    * @return The accumulated return values of the slot invocations as processed by the accumulator.
1659    *
1660    * @deprecated This is apparently not useful, but please let us know if you need it.
1661    */
1662   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4)
1663     {
1664       T_accumulator accumulator;
1665
1666       if (!impl)
1667         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1668
1669       signal_exec exec(impl);
1670       temp_slot_list slots(impl->slots_);
1671
1672       self_type self (_A_a1, _A_a2, _A_a3, _A_a4);
1673       return accumulator(slot_reverse_iterator_buf_type(slots.end(), &self),
1674                          slot_reverse_iterator_buf_type(slots.begin(), &self));
1675     }
1676 #endif // SIGCXX_DISABLE_DEPRECATED
1677
1678   
1679   type_trait_take_t<T_arg1> _A_a1_;
1680   type_trait_take_t<T_arg2> _A_a2_;
1681   type_trait_take_t<T_arg3> _A_a3_;
1682   type_trait_take_t<T_arg4> _A_a4_;
1683 };
1684
1685 /** Abstracts signal emission.
1686  * This template specialization implements an optimized emit()
1687  * function for the case that no accumulator is used.
1688  */
1689 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4>
1690 struct signal_emit4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, nil>
1691 {
1692   typedef signal_emit4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, nil > self_type;
1693   typedef T_return result_type;
1694   typedef slot<T_return(T_arg1, T_arg2, T_arg3, T_arg4)> slot_type;
1695   typedef signal_impl::const_iterator_type iterator_type;
1696   typedef typename slot_type::call_type call_type;
1697
1698   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1699    * The arguments are passed directly on to the slots.
1700    * The return value of the last slot invoked is returned.
1701    * @param first An iterator pointing to the first slot in the list.
1702    * @param last An iterator pointing to the last slot in the list.
1703    * @param _A_a1 Argument to be passed on to the slots.
1704    * @param _A_a2 Argument to be passed on to the slots.
1705    * @param _A_a3 Argument to be passed on to the slots.
1706    * @param _A_a4 Argument to be passed on to the slots.
1707    * @return The return value of the last slot invoked.
1708    */
1709   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4)
1710     {
1711       if (!impl || impl->slots_.empty())
1712         return T_return();
1713         
1714       signal_exec exec(impl);
1715       T_return r_ = T_return(); 
1716       
1717       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
1718       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
1719       { 
1720         temp_slot_list slots(impl->slots_);
1721         auto it = slots.begin();
1722         for (; it != slots.end(); ++it)
1723           if (!it->empty() && !it->blocked()) break;
1724           
1725         if (it == slots.end())
1726           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
1727   
1728         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4);
1729         for (++it; it != slots.end(); ++it)
1730           {
1731             if (it->empty() || it->blocked())
1732               continue;
1733             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4);
1734           }
1735       }
1736       
1737       return r_;
1738     }
1739
1740 #ifndef SIGCXX_DISABLE_DEPRECATED
1741   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
1742    * The arguments are passed directly on to the slots.
1743    * The return value of the last slot invoked is returned.
1744    * @param first An iterator pointing to the first slot in the list.
1745    * @param last An iterator pointing to the last slot in the list.
1746    * @param _A_a1 Argument to be passed on to the slots.
1747    * @param _A_a2 Argument to be passed on to the slots.
1748    * @param _A_a3 Argument to be passed on to the slots.
1749    * @param _A_a4 Argument to be passed on to the slots.
1750    * @return The return value of the last slot invoked.
1751    *
1752    * @deprecated This is apparently not useful, but please let us know if you need it.
1753    */
1754   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4)
1755     {
1756       if (!impl || impl->slots_.empty())
1757         return T_return();
1758         
1759       signal_exec exec(impl);
1760       T_return r_ = T_return(); 
1761       
1762       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
1763       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
1764       { 
1765 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
1766         typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
1767 #else
1768         typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
1769                                        slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
1770 #endif
1771
1772         temp_slot_list slots(impl->slots_);
1773         reverse_iterator_type it(slots.end());
1774         for (; it != reverse_iterator_type(slots.begin()); ++it)
1775           if (!it->empty() && !it->blocked()) break;
1776           
1777         if (it == reverse_iterator_type(slots.begin()))
1778           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
1779   
1780         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4);
1781         for (++it; it != reverse_iterator_type(slots.begin()); ++it)
1782           {
1783             if (it->empty() || it->blocked())
1784               continue;
1785             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4);
1786           }
1787       }
1788       
1789       return r_;
1790     }
1791 #endif // SIGCXX_DISABLE_DEPRECATED
1792 };
1793
1794 /** Abstracts signal emission.
1795  * This template specialization implements an optimized emit()
1796  * function for the case that no accumulator is used and the
1797  * return type is @p void.
1798  */
1799 template <class T_arg1, class T_arg2, class T_arg3, class T_arg4>
1800 struct signal_emit4<void, T_arg1, T_arg2, T_arg3, T_arg4, nil>
1801 {
1802   typedef signal_emit4<void, T_arg1, T_arg2, T_arg3, T_arg4, nil> self_type;
1803   typedef void result_type;
1804   typedef slot<void(T_arg1, T_arg2, T_arg3, T_arg4)> slot_type;
1805   typedef signal_impl::const_iterator_type iterator_type;
1806   typedef typename slot_type::call_type call_type;
1807
1808   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1809    * The arguments are passed directly on to the slots.
1810    * @param first An iterator pointing to the first slot in the list.
1811    * @param last An iterator pointing to the last slot in the list.
1812    * @param _A_a1 Argument to be passed on to the slots.
1813    * @param _A_a2 Argument to be passed on to the slots.
1814    * @param _A_a3 Argument to be passed on to the slots.
1815    * @param _A_a4 Argument to be passed on to the slots.
1816    */
1817   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4)
1818     {
1819       if (!impl || impl->slots_.empty()) return;
1820       signal_exec exec(impl);
1821       temp_slot_list slots(impl->slots_);
1822
1823       for (const auto& slot : slots)
1824         {
1825           if (slot.empty() || slot.blocked())
1826             continue;
1827           (sigc::internal::function_pointer_cast<call_type>(slot.rep_->call_))(slot.rep_, _A_a1, _A_a2, _A_a3, _A_a4);
1828         }
1829     }
1830
1831 #ifndef SIGCXX_DISABLE_DEPRECATED
1832   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
1833    * The arguments are passed directly on to the slots.
1834    * @param first An iterator pointing to the first slot in the list.
1835    * @param last An iterator pointing to the last slot in the list.
1836    * @param _A_a1 Argument to be passed on to the slots.
1837    * @param _A_a2 Argument to be passed on to the slots.
1838    * @param _A_a3 Argument to be passed on to the slots.
1839    * @param _A_a4 Argument to be passed on to the slots.
1840    *
1841    * @deprecated This is apparently not useful, but please let us know if you need it.
1842    */
1843   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4)
1844     {
1845       if (!impl || impl->slots_.empty()) return;
1846       signal_exec exec(impl);
1847       temp_slot_list slots(impl->slots_);
1848
1849 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
1850       typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
1851 #else
1852       typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
1853                                      slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
1854 #endif
1855       for (auto it = reverse_iterator_type(slots.end()); it != reverse_iterator_type(slots.begin()); ++it)
1856         {
1857           if (it->empty() || it->blocked())
1858             continue;
1859           (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4);
1860         }
1861     }
1862 #endif // SIGCXX_DISABLE_DEPRECATED
1863 };
1864
1865 /** Abstracts signal emission.
1866  * This template implements the emit() function of signal5.
1867  * Template specializations are available to optimize signal
1868  * emission when no accumulator is used, for example when the template
1869  * argument @e T_accumulator is @p nil.
1870  */
1871 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5, class T_accumulator>
1872 struct signal_emit5
1873 {
1874   typedef signal_emit5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_accumulator> self_type;
1875   typedef typename T_accumulator::result_type result_type;
1876   typedef slot<T_return(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5)> slot_type;
1877   typedef internal::slot_iterator_buf<self_type, T_return> slot_iterator_buf_type;
1878   typedef internal::slot_reverse_iterator_buf<self_type, T_return> slot_reverse_iterator_buf_type;
1879   typedef signal_impl::const_iterator_type iterator_type;
1880
1881   /** Instantiates the class.
1882    * The parameters are stored in member variables. operator()() passes
1883    * the values on to some slot.
1884    */
1885   signal_emit5(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5) 
1886     : _A_a1_(_A_a1), _A_a2_(_A_a2), _A_a3_(_A_a3), _A_a4_(_A_a4), _A_a5_(_A_a5) {}
1887
1888
1889   /** Invokes a slot using the buffered parameter values.
1890    * @param _A_slot Some slot to invoke.
1891    * @return The slot's return value.
1892    */
1893   T_return operator()(const slot_type& _A_slot) const
1894     { return (sigc::internal::function_pointer_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_, _A_a1_, _A_a2_, _A_a3_, _A_a4_, _A_a5_); }
1895
1896   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1897    * The arguments are buffered in a temporary instance of signal_emit5.
1898
1899    * @param _A_a1 Argument to be passed on to the slots.
1900    * @param _A_a2 Argument to be passed on to the slots.
1901    * @param _A_a3 Argument to be passed on to the slots.
1902    * @param _A_a4 Argument to be passed on to the slots.
1903    * @param _A_a5 Argument to be passed on to the slots.
1904    * @return The accumulated return values of the slot invocations as processed by the accumulator.
1905    */
1906   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5)
1907     {
1908       T_accumulator accumulator;
1909
1910       if (!impl)
1911         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1912
1913       signal_exec exec(impl);
1914       temp_slot_list slots(impl->slots_);
1915
1916       self_type self (_A_a1, _A_a2, _A_a3, _A_a4, _A_a5);
1917       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
1918                          slot_iterator_buf_type(slots.end(), &self));
1919     }
1920
1921 #ifndef SIGCXX_DISABLE_DEPRECATED
1922   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
1923    * The arguments are buffered in a temporary instance of signal_emit5.
1924
1925    * @param _A_a1 Argument to be passed on to the slots.
1926    * @param _A_a2 Argument to be passed on to the slots.
1927    * @param _A_a3 Argument to be passed on to the slots.
1928    * @param _A_a4 Argument to be passed on to the slots.
1929    * @param _A_a5 Argument to be passed on to the slots.
1930    * @return The accumulated return values of the slot invocations as processed by the accumulator.
1931    *
1932    * @deprecated This is apparently not useful, but please let us know if you need it.
1933    */
1934   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5)
1935     {
1936       T_accumulator accumulator;
1937
1938       if (!impl)
1939         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1940
1941       signal_exec exec(impl);
1942       temp_slot_list slots(impl->slots_);
1943
1944       self_type self (_A_a1, _A_a2, _A_a3, _A_a4, _A_a5);
1945       return accumulator(slot_reverse_iterator_buf_type(slots.end(), &self),
1946                          slot_reverse_iterator_buf_type(slots.begin(), &self));
1947     }
1948 #endif // SIGCXX_DISABLE_DEPRECATED
1949
1950   
1951   type_trait_take_t<T_arg1> _A_a1_;
1952   type_trait_take_t<T_arg2> _A_a2_;
1953   type_trait_take_t<T_arg3> _A_a3_;
1954   type_trait_take_t<T_arg4> _A_a4_;
1955   type_trait_take_t<T_arg5> _A_a5_;
1956 };
1957
1958 /** Abstracts signal emission.
1959  * This template specialization implements an optimized emit()
1960  * function for the case that no accumulator is used.
1961  */
1962 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5>
1963 struct signal_emit5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil>
1964 {
1965   typedef signal_emit5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil > self_type;
1966   typedef T_return result_type;
1967   typedef slot<T_return(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5)> slot_type;
1968   typedef signal_impl::const_iterator_type iterator_type;
1969   typedef typename slot_type::call_type call_type;
1970
1971   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1972    * The arguments are passed directly on to the slots.
1973    * The return value of the last slot invoked is returned.
1974    * @param first An iterator pointing to the first slot in the list.
1975    * @param last An iterator pointing to the last slot in the list.
1976    * @param _A_a1 Argument to be passed on to the slots.
1977    * @param _A_a2 Argument to be passed on to the slots.
1978    * @param _A_a3 Argument to be passed on to the slots.
1979    * @param _A_a4 Argument to be passed on to the slots.
1980    * @param _A_a5 Argument to be passed on to the slots.
1981    * @return The return value of the last slot invoked.
1982    */
1983   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5)
1984     {
1985       if (!impl || impl->slots_.empty())
1986         return T_return();
1987         
1988       signal_exec exec(impl);
1989       T_return r_ = T_return(); 
1990       
1991       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
1992       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
1993       { 
1994         temp_slot_list slots(impl->slots_);
1995         auto it = slots.begin();
1996         for (; it != slots.end(); ++it)
1997           if (!it->empty() && !it->blocked()) break;
1998           
1999         if (it == slots.end())
2000           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
2001   
2002         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5);
2003         for (++it; it != slots.end(); ++it)
2004           {
2005             if (it->empty() || it->blocked())
2006               continue;
2007             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5);
2008           }
2009       }
2010       
2011       return r_;
2012     }
2013
2014 #ifndef SIGCXX_DISABLE_DEPRECATED
2015   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
2016    * The arguments are passed directly on to the slots.
2017    * The return value of the last slot invoked is returned.
2018    * @param first An iterator pointing to the first slot in the list.
2019    * @param last An iterator pointing to the last slot in the list.
2020    * @param _A_a1 Argument to be passed on to the slots.
2021    * @param _A_a2 Argument to be passed on to the slots.
2022    * @param _A_a3 Argument to be passed on to the slots.
2023    * @param _A_a4 Argument to be passed on to the slots.
2024    * @param _A_a5 Argument to be passed on to the slots.
2025    * @return The return value of the last slot invoked.
2026    *
2027    * @deprecated This is apparently not useful, but please let us know if you need it.
2028    */
2029   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5)
2030     {
2031       if (!impl || impl->slots_.empty())
2032         return T_return();
2033         
2034       signal_exec exec(impl);
2035       T_return r_ = T_return(); 
2036       
2037       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
2038       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
2039       { 
2040 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
2041         typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
2042 #else
2043         typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
2044                                        slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
2045 #endif
2046
2047         temp_slot_list slots(impl->slots_);
2048         reverse_iterator_type it(slots.end());
2049         for (; it != reverse_iterator_type(slots.begin()); ++it)
2050           if (!it->empty() && !it->blocked()) break;
2051           
2052         if (it == reverse_iterator_type(slots.begin()))
2053           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
2054   
2055         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5);
2056         for (++it; it != reverse_iterator_type(slots.begin()); ++it)
2057           {
2058             if (it->empty() || it->blocked())
2059               continue;
2060             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5);
2061           }
2062       }
2063       
2064       return r_;
2065     }
2066 #endif // SIGCXX_DISABLE_DEPRECATED
2067 };
2068
2069 /** Abstracts signal emission.
2070  * This template specialization implements an optimized emit()
2071  * function for the case that no accumulator is used and the
2072  * return type is @p void.
2073  */
2074 template <class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5>
2075 struct signal_emit5<void, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil>
2076 {
2077   typedef signal_emit5<void, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil> self_type;
2078   typedef void result_type;
2079   typedef slot<void(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5)> slot_type;
2080   typedef signal_impl::const_iterator_type iterator_type;
2081   typedef typename slot_type::call_type call_type;
2082
2083   /** Executes a list of slots using an accumulator of type @e T_accumulator.
2084    * The arguments are passed directly on to the slots.
2085    * @param first An iterator pointing to the first slot in the list.
2086    * @param last An iterator pointing to the last slot in the list.
2087    * @param _A_a1 Argument to be passed on to the slots.
2088    * @param _A_a2 Argument to be passed on to the slots.
2089    * @param _A_a3 Argument to be passed on to the slots.
2090    * @param _A_a4 Argument to be passed on to the slots.
2091    * @param _A_a5 Argument to be passed on to the slots.
2092    */
2093   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5)
2094     {
2095       if (!impl || impl->slots_.empty()) return;
2096       signal_exec exec(impl);
2097       temp_slot_list slots(impl->slots_);
2098
2099       for (const auto& slot : slots)
2100         {
2101           if (slot.empty() || slot.blocked())
2102             continue;
2103           (sigc::internal::function_pointer_cast<call_type>(slot.rep_->call_))(slot.rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5);
2104         }
2105     }
2106
2107 #ifndef SIGCXX_DISABLE_DEPRECATED
2108   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
2109    * The arguments are passed directly on to the slots.
2110    * @param first An iterator pointing to the first slot in the list.
2111    * @param last An iterator pointing to the last slot in the list.
2112    * @param _A_a1 Argument to be passed on to the slots.
2113    * @param _A_a2 Argument to be passed on to the slots.
2114    * @param _A_a3 Argument to be passed on to the slots.
2115    * @param _A_a4 Argument to be passed on to the slots.
2116    * @param _A_a5 Argument to be passed on to the slots.
2117    *
2118    * @deprecated This is apparently not useful, but please let us know if you need it.
2119    */
2120   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5)
2121     {
2122       if (!impl || impl->slots_.empty()) return;
2123       signal_exec exec(impl);
2124       temp_slot_list slots(impl->slots_);
2125
2126 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
2127       typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
2128 #else
2129       typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
2130                                      slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
2131 #endif
2132       for (auto it = reverse_iterator_type(slots.end()); it != reverse_iterator_type(slots.begin()); ++it)
2133         {
2134           if (it->empty() || it->blocked())
2135             continue;
2136           (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5);
2137         }
2138     }
2139 #endif // SIGCXX_DISABLE_DEPRECATED
2140 };
2141
2142 /** Abstracts signal emission.
2143  * This template implements the emit() function of signal6.
2144  * Template specializations are available to optimize signal
2145  * emission when no accumulator is used, for example when the template
2146  * argument @e T_accumulator is @p nil.
2147  */
2148 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5, class T_arg6, class T_accumulator>
2149 struct signal_emit6
2150 {
2151   typedef signal_emit6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_accumulator> self_type;
2152   typedef typename T_accumulator::result_type result_type;
2153   typedef slot<T_return(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6)> slot_type;
2154   typedef internal::slot_iterator_buf<self_type, T_return> slot_iterator_buf_type;
2155   typedef internal::slot_reverse_iterator_buf<self_type, T_return> slot_reverse_iterator_buf_type;
2156   typedef signal_impl::const_iterator_type iterator_type;
2157
2158   /** Instantiates the class.
2159    * The parameters are stored in member variables. operator()() passes
2160    * the values on to some slot.
2161    */
2162   signal_emit6(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6) 
2163     : _A_a1_(_A_a1), _A_a2_(_A_a2), _A_a3_(_A_a3), _A_a4_(_A_a4), _A_a5_(_A_a5), _A_a6_(_A_a6) {}
2164
2165
2166   /** Invokes a slot using the buffered parameter values.
2167    * @param _A_slot Some slot to invoke.
2168    * @return The slot's return value.
2169    */
2170   T_return operator()(const slot_type& _A_slot) const
2171     { return (sigc::internal::function_pointer_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_, _A_a1_, _A_a2_, _A_a3_, _A_a4_, _A_a5_, _A_a6_); }
2172
2173   /** Executes a list of slots using an accumulator of type @e T_accumulator.
2174    * The arguments are buffered in a temporary instance of signal_emit6.
2175
2176    * @param _A_a1 Argument to be passed on to the slots.
2177    * @param _A_a2 Argument to be passed on to the slots.
2178    * @param _A_a3 Argument to be passed on to the slots.
2179    * @param _A_a4 Argument to be passed on to the slots.
2180    * @param _A_a5 Argument to be passed on to the slots.
2181    * @param _A_a6 Argument to be passed on to the slots.
2182    * @return The accumulated return values of the slot invocations as processed by the accumulator.
2183    */
2184   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6)
2185     {
2186       T_accumulator accumulator;
2187
2188       if (!impl)
2189         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
2190
2191       signal_exec exec(impl);
2192       temp_slot_list slots(impl->slots_);
2193
2194       self_type self (_A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6);
2195       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
2196                          slot_iterator_buf_type(slots.end(), &self));
2197     }
2198
2199 #ifndef SIGCXX_DISABLE_DEPRECATED
2200   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
2201    * The arguments are buffered in a temporary instance of signal_emit6.
2202
2203    * @param _A_a1 Argument to be passed on to the slots.
2204    * @param _A_a2 Argument to be passed on to the slots.
2205    * @param _A_a3 Argument to be passed on to the slots.
2206    * @param _A_a4 Argument to be passed on to the slots.
2207    * @param _A_a5 Argument to be passed on to the slots.
2208    * @param _A_a6 Argument to be passed on to the slots.
2209    * @return The accumulated return values of the slot invocations as processed by the accumulator.
2210    *
2211    * @deprecated This is apparently not useful, but please let us know if you need it.
2212    */
2213   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6)
2214     {
2215       T_accumulator accumulator;
2216
2217       if (!impl)
2218         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
2219
2220       signal_exec exec(impl);
2221       temp_slot_list slots(impl->slots_);
2222
2223       self_type self (_A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6);
2224       return accumulator(slot_reverse_iterator_buf_type(slots.end(), &self),
2225                          slot_reverse_iterator_buf_type(slots.begin(), &self));
2226     }
2227 #endif // SIGCXX_DISABLE_DEPRECATED
2228
2229   
2230   type_trait_take_t<T_arg1> _A_a1_;
2231   type_trait_take_t<T_arg2> _A_a2_;
2232   type_trait_take_t<T_arg3> _A_a3_;
2233   type_trait_take_t<T_arg4> _A_a4_;
2234   type_trait_take_t<T_arg5> _A_a5_;
2235   type_trait_take_t<T_arg6> _A_a6_;
2236 };
2237
2238 /** Abstracts signal emission.
2239  * This template specialization implements an optimized emit()
2240  * function for the case that no accumulator is used.
2241  */
2242 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5, class T_arg6>
2243 struct signal_emit6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil>
2244 {
2245   typedef signal_emit6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil > self_type;
2246   typedef T_return result_type;
2247   typedef slot<T_return(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6)> slot_type;
2248   typedef signal_impl::const_iterator_type iterator_type;
2249   typedef typename slot_type::call_type call_type;
2250
2251   /** Executes a list of slots using an accumulator of type @e T_accumulator.
2252    * The arguments are passed directly on to the slots.
2253    * The return value of the last slot invoked is returned.
2254    * @param first An iterator pointing to the first slot in the list.
2255    * @param last An iterator pointing to the last slot in the list.
2256    * @param _A_a1 Argument to be passed on to the slots.
2257    * @param _A_a2 Argument to be passed on to the slots.
2258    * @param _A_a3 Argument to be passed on to the slots.
2259    * @param _A_a4 Argument to be passed on to the slots.
2260    * @param _A_a5 Argument to be passed on to the slots.
2261    * @param _A_a6 Argument to be passed on to the slots.
2262    * @return The return value of the last slot invoked.
2263    */
2264   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6)
2265     {
2266       if (!impl || impl->slots_.empty())
2267         return T_return();
2268         
2269       signal_exec exec(impl);
2270       T_return r_ = T_return(); 
2271       
2272       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
2273       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
2274       { 
2275         temp_slot_list slots(impl->slots_);
2276         auto it = slots.begin();
2277         for (; it != slots.end(); ++it)
2278           if (!it->empty() && !it->blocked()) break;
2279           
2280         if (it == slots.end())
2281           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
2282   
2283         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6);
2284         for (++it; it != slots.end(); ++it)
2285           {
2286             if (it->empty() || it->blocked())
2287               continue;
2288             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6);
2289           }
2290       }
2291       
2292       return r_;
2293     }
2294
2295 #ifndef SIGCXX_DISABLE_DEPRECATED
2296   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
2297    * The arguments are passed directly on to the slots.
2298    * The return value of the last slot invoked is returned.
2299    * @param first An iterator pointing to the first slot in the list.
2300    * @param last An iterator pointing to the last slot in the list.
2301    * @param _A_a1 Argument to be passed on to the slots.
2302    * @param _A_a2 Argument to be passed on to the slots.
2303    * @param _A_a3 Argument to be passed on to the slots.
2304    * @param _A_a4 Argument to be passed on to the slots.
2305    * @param _A_a5 Argument to be passed on to the slots.
2306    * @param _A_a6 Argument to be passed on to the slots.
2307    * @return The return value of the last slot invoked.
2308    *
2309    * @deprecated This is apparently not useful, but please let us know if you need it.
2310    */
2311   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6)
2312     {
2313       if (!impl || impl->slots_.empty())
2314         return T_return();
2315         
2316       signal_exec exec(impl);
2317       T_return r_ = T_return(); 
2318       
2319       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
2320       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
2321       { 
2322 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
2323         typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
2324 #else
2325         typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
2326                                        slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
2327 #endif
2328
2329         temp_slot_list slots(impl->slots_);
2330         reverse_iterator_type it(slots.end());
2331         for (; it != reverse_iterator_type(slots.begin()); ++it)
2332           if (!it->empty() && !it->blocked()) break;
2333           
2334         if (it == reverse_iterator_type(slots.begin()))
2335           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
2336   
2337         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6);
2338         for (++it; it != reverse_iterator_type(slots.begin()); ++it)
2339           {
2340             if (it->empty() || it->blocked())
2341               continue;
2342             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6);
2343           }
2344       }
2345       
2346       return r_;
2347     }
2348 #endif // SIGCXX_DISABLE_DEPRECATED
2349 };
2350
2351 /** Abstracts signal emission.
2352  * This template specialization implements an optimized emit()
2353  * function for the case that no accumulator is used and the
2354  * return type is @p void.
2355  */
2356 template <class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5, class T_arg6>
2357 struct signal_emit6<void, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil>
2358 {
2359   typedef signal_emit6<void, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil> self_type;
2360   typedef void result_type;
2361   typedef slot<void(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6)> slot_type;
2362   typedef signal_impl::const_iterator_type iterator_type;
2363   typedef typename slot_type::call_type call_type;
2364
2365   /** Executes a list of slots using an accumulator of type @e T_accumulator.
2366    * The arguments are passed directly on to the slots.
2367    * @param first An iterator pointing to the first slot in the list.
2368    * @param last An iterator pointing to the last slot in the list.
2369    * @param _A_a1 Argument to be passed on to the slots.
2370    * @param _A_a2 Argument to be passed on to the slots.
2371    * @param _A_a3 Argument to be passed on to the slots.
2372    * @param _A_a4 Argument to be passed on to the slots.
2373    * @param _A_a5 Argument to be passed on to the slots.
2374    * @param _A_a6 Argument to be passed on to the slots.
2375    */
2376   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6)
2377     {
2378       if (!impl || impl->slots_.empty()) return;
2379       signal_exec exec(impl);
2380       temp_slot_list slots(impl->slots_);
2381
2382       for (const auto& slot : slots)
2383         {
2384           if (slot.empty() || slot.blocked())
2385             continue;
2386           (sigc::internal::function_pointer_cast<call_type>(slot.rep_->call_))(slot.rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6);
2387         }
2388     }
2389
2390 #ifndef SIGCXX_DISABLE_DEPRECATED
2391   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
2392    * The arguments are passed directly on to the slots.
2393    * @param first An iterator pointing to the first slot in the list.
2394    * @param last An iterator pointing to the last slot in the list.
2395    * @param _A_a1 Argument to be passed on to the slots.
2396    * @param _A_a2 Argument to be passed on to the slots.
2397    * @param _A_a3 Argument to be passed on to the slots.
2398    * @param _A_a4 Argument to be passed on to the slots.
2399    * @param _A_a5 Argument to be passed on to the slots.
2400    * @param _A_a6 Argument to be passed on to the slots.
2401    *
2402    * @deprecated This is apparently not useful, but please let us know if you need it.
2403    */
2404   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6)
2405     {
2406       if (!impl || impl->slots_.empty()) return;
2407       signal_exec exec(impl);
2408       temp_slot_list slots(impl->slots_);
2409
2410 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
2411       typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
2412 #else
2413       typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
2414                                      slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
2415 #endif
2416       for (auto it = reverse_iterator_type(slots.end()); it != reverse_iterator_type(slots.begin()); ++it)
2417         {
2418           if (it->empty() || it->blocked())
2419             continue;
2420           (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6);
2421         }
2422     }
2423 #endif // SIGCXX_DISABLE_DEPRECATED
2424 };
2425
2426 /** Abstracts signal emission.
2427  * This template implements the emit() function of signal7.
2428  * Template specializations are available to optimize signal
2429  * emission when no accumulator is used, for example when the template
2430  * argument @e T_accumulator is @p nil.
2431  */
2432 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5, class T_arg6, class T_arg7, class T_accumulator>
2433 struct signal_emit7
2434 {
2435   typedef signal_emit7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_accumulator> self_type;
2436   typedef typename T_accumulator::result_type result_type;
2437   typedef slot<T_return(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7)> slot_type;
2438   typedef internal::slot_iterator_buf<self_type, T_return> slot_iterator_buf_type;
2439   typedef internal::slot_reverse_iterator_buf<self_type, T_return> slot_reverse_iterator_buf_type;
2440   typedef signal_impl::const_iterator_type iterator_type;
2441
2442   /** Instantiates the class.
2443    * The parameters are stored in member variables. operator()() passes
2444    * the values on to some slot.
2445    */
2446   signal_emit7(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6, type_trait_take_t<T_arg7> _A_a7) 
2447     : _A_a1_(_A_a1), _A_a2_(_A_a2), _A_a3_(_A_a3), _A_a4_(_A_a4), _A_a5_(_A_a5), _A_a6_(_A_a6), _A_a7_(_A_a7) {}
2448
2449
2450   /** Invokes a slot using the buffered parameter values.
2451    * @param _A_slot Some slot to invoke.
2452    * @return The slot's return value.
2453    */
2454   T_return operator()(const slot_type& _A_slot) const
2455     { return (sigc::internal::function_pointer_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_, _A_a1_, _A_a2_, _A_a3_, _A_a4_, _A_a5_, _A_a6_, _A_a7_); }
2456
2457   /** Executes a list of slots using an accumulator of type @e T_accumulator.
2458    * The arguments are buffered in a temporary instance of signal_emit7.
2459
2460    * @param _A_a1 Argument to be passed on to the slots.
2461    * @param _A_a2 Argument to be passed on to the slots.
2462    * @param _A_a3 Argument to be passed on to the slots.
2463    * @param _A_a4 Argument to be passed on to the slots.
2464    * @param _A_a5 Argument to be passed on to the slots.
2465    * @param _A_a6 Argument to be passed on to the slots.
2466    * @param _A_a7 Argument to be passed on to the slots.
2467    * @return The accumulated return values of the slot invocations as processed by the accumulator.
2468    */
2469   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6, type_trait_take_t<T_arg7> _A_a7)
2470     {
2471       T_accumulator accumulator;
2472
2473       if (!impl)
2474         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
2475
2476       signal_exec exec(impl);
2477       temp_slot_list slots(impl->slots_);
2478
2479       self_type self (_A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6, _A_a7);
2480       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
2481                          slot_iterator_buf_type(slots.end(), &self));
2482     }
2483
2484 #ifndef SIGCXX_DISABLE_DEPRECATED
2485   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
2486    * The arguments are buffered in a temporary instance of signal_emit7.
2487
2488    * @param _A_a1 Argument to be passed on to the slots.
2489    * @param _A_a2 Argument to be passed on to the slots.
2490    * @param _A_a3 Argument to be passed on to the slots.
2491    * @param _A_a4 Argument to be passed on to the slots.
2492    * @param _A_a5 Argument to be passed on to the slots.
2493    * @param _A_a6 Argument to be passed on to the slots.
2494    * @param _A_a7 Argument to be passed on to the slots.
2495    * @return The accumulated return values of the slot invocations as processed by the accumulator.
2496    *
2497    * @deprecated This is apparently not useful, but please let us know if you need it.
2498    */
2499   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6, type_trait_take_t<T_arg7> _A_a7)
2500     {
2501       T_accumulator accumulator;
2502
2503       if (!impl)
2504         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
2505
2506       signal_exec exec(impl);
2507       temp_slot_list slots(impl->slots_);
2508
2509       self_type self (_A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6, _A_a7);
2510       return accumulator(slot_reverse_iterator_buf_type(slots.end(), &self),
2511                          slot_reverse_iterator_buf_type(slots.begin(), &self));
2512     }
2513 #endif // SIGCXX_DISABLE_DEPRECATED
2514
2515   
2516   type_trait_take_t<T_arg1> _A_a1_;
2517   type_trait_take_t<T_arg2> _A_a2_;
2518   type_trait_take_t<T_arg3> _A_a3_;
2519   type_trait_take_t<T_arg4> _A_a4_;
2520   type_trait_take_t<T_arg5> _A_a5_;
2521   type_trait_take_t<T_arg6> _A_a6_;
2522   type_trait_take_t<T_arg7> _A_a7_;
2523 };
2524
2525 /** Abstracts signal emission.
2526  * This template specialization implements an optimized emit()
2527  * function for the case that no accumulator is used.
2528  */
2529 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5, class T_arg6, class T_arg7>
2530 struct signal_emit7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil>
2531 {
2532   typedef signal_emit7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil > self_type;
2533   typedef T_return result_type;
2534   typedef slot<T_return(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7)> slot_type;
2535   typedef signal_impl::const_iterator_type iterator_type;
2536   typedef typename slot_type::call_type call_type;
2537
2538   /** Executes a list of slots using an accumulator of type @e T_accumulator.
2539    * The arguments are passed directly on to the slots.
2540    * The return value of the last slot invoked is returned.
2541    * @param first An iterator pointing to the first slot in the list.
2542    * @param last An iterator pointing to the last slot in the list.
2543    * @param _A_a1 Argument to be passed on to the slots.
2544    * @param _A_a2 Argument to be passed on to the slots.
2545    * @param _A_a3 Argument to be passed on to the slots.
2546    * @param _A_a4 Argument to be passed on to the slots.
2547    * @param _A_a5 Argument to be passed on to the slots.
2548    * @param _A_a6 Argument to be passed on to the slots.
2549    * @param _A_a7 Argument to be passed on to the slots.
2550    * @return The return value of the last slot invoked.
2551    */
2552   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6, type_trait_take_t<T_arg7> _A_a7)
2553     {
2554       if (!impl || impl->slots_.empty())
2555         return T_return();
2556         
2557       signal_exec exec(impl);
2558       T_return r_ = T_return(); 
2559       
2560       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
2561       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
2562       { 
2563         temp_slot_list slots(impl->slots_);
2564         auto it = slots.begin();
2565         for (; it != slots.end(); ++it)
2566           if (!it->empty() && !it->blocked()) break;
2567           
2568         if (it == slots.end())
2569           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
2570   
2571         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6, _A_a7);
2572         for (++it; it != slots.end(); ++it)
2573           {
2574             if (it->empty() || it->blocked())
2575               continue;
2576             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6, _A_a7);
2577           }
2578       }
2579       
2580       return r_;
2581     }
2582
2583 #ifndef SIGCXX_DISABLE_DEPRECATED
2584   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
2585    * The arguments are passed directly on to the slots.
2586    * The return value of the last slot invoked is returned.
2587    * @param first An iterator pointing to the first slot in the list.
2588    * @param last An iterator pointing to the last slot in the list.
2589    * @param _A_a1 Argument to be passed on to the slots.
2590    * @param _A_a2 Argument to be passed on to the slots.
2591    * @param _A_a3 Argument to be passed on to the slots.
2592    * @param _A_a4 Argument to be passed on to the slots.
2593    * @param _A_a5 Argument to be passed on to the slots.
2594    * @param _A_a6 Argument to be passed on to the slots.
2595    * @param _A_a7 Argument to be passed on to the slots.
2596    * @return The return value of the last slot invoked.
2597    *
2598    * @deprecated This is apparently not useful, but please let us know if you need it.
2599    */
2600   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6, type_trait_take_t<T_arg7> _A_a7)
2601     {
2602       if (!impl || impl->slots_.empty())
2603         return T_return();
2604         
2605       signal_exec exec(impl);
2606       T_return r_ = T_return(); 
2607       
2608       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
2609       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
2610       { 
2611 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
2612         typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
2613 #else
2614         typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
2615                                        slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
2616 #endif
2617
2618         temp_slot_list slots(impl->slots_);
2619         reverse_iterator_type it(slots.end());
2620         for (; it != reverse_iterator_type(slots.begin()); ++it)
2621           if (!it->empty() && !it->blocked()) break;
2622           
2623         if (it == reverse_iterator_type(slots.begin()))
2624           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
2625   
2626         r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6, _A_a7);
2627         for (++it; it != reverse_iterator_type(slots.begin()); ++it)
2628           {
2629             if (it->empty() || it->blocked())
2630               continue;
2631             r_ = (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6, _A_a7);
2632           }
2633       }
2634       
2635       return r_;
2636     }
2637 #endif // SIGCXX_DISABLE_DEPRECATED
2638 };
2639
2640 /** Abstracts signal emission.
2641  * This template specialization implements an optimized emit()
2642  * function for the case that no accumulator is used and the
2643  * return type is @p void.
2644  */
2645 template <class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5, class T_arg6, class T_arg7>
2646 struct signal_emit7<void, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil>
2647 {
2648   typedef signal_emit7<void, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil> self_type;
2649   typedef void result_type;
2650   typedef slot<void(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7)> slot_type;
2651   typedef signal_impl::const_iterator_type iterator_type;
2652   typedef typename slot_type::call_type call_type;
2653
2654   /** Executes a list of slots using an accumulator of type @e T_accumulator.
2655    * The arguments are passed directly on to the slots.
2656    * @param first An iterator pointing to the first slot in the list.
2657    * @param last An iterator pointing to the last slot in the list.
2658    * @param _A_a1 Argument to be passed on to the slots.
2659    * @param _A_a2 Argument to be passed on to the slots.
2660    * @param _A_a3 Argument to be passed on to the slots.
2661    * @param _A_a4 Argument to be passed on to the slots.
2662    * @param _A_a5 Argument to be passed on to the slots.
2663    * @param _A_a6 Argument to be passed on to the slots.
2664    * @param _A_a7 Argument to be passed on to the slots.
2665    */
2666   static result_type emit(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6, type_trait_take_t<T_arg7> _A_a7)
2667     {
2668       if (!impl || impl->slots_.empty()) return;
2669       signal_exec exec(impl);
2670       temp_slot_list slots(impl->slots_);
2671
2672       for (const auto& slot : slots)
2673         {
2674           if (slot.empty() || slot.blocked())
2675             continue;
2676           (sigc::internal::function_pointer_cast<call_type>(slot.rep_->call_))(slot.rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6, _A_a7);
2677         }
2678     }
2679
2680 #ifndef SIGCXX_DISABLE_DEPRECATED
2681   /** Executes a list of slots using an accumulator of type @e T_accumulator in reverse order.
2682    * The arguments are passed directly on to the slots.
2683    * @param first An iterator pointing to the first slot in the list.
2684    * @param last An iterator pointing to the last slot in the list.
2685    * @param _A_a1 Argument to be passed on to the slots.
2686    * @param _A_a2 Argument to be passed on to the slots.
2687    * @param _A_a3 Argument to be passed on to the slots.
2688    * @param _A_a4 Argument to be passed on to the slots.
2689    * @param _A_a5 Argument to be passed on to the slots.
2690    * @param _A_a6 Argument to be passed on to the slots.
2691    * @param _A_a7 Argument to be passed on to the slots.
2692    *
2693    * @deprecated This is apparently not useful, but please let us know if you need it.
2694    */
2695   static result_type emit_reverse(signal_impl* impl, type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6, type_trait_take_t<T_arg7> _A_a7)
2696     {
2697       if (!impl || impl->slots_.empty()) return;
2698       signal_exec exec(impl);
2699       temp_slot_list slots(impl->slots_);
2700
2701 #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
2702       typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
2703 #else
2704       typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
2705                                      slot_base, slot_base&, slot_base*, std::ptrdiff_t> reverse_iterator_type;
2706 #endif
2707       for (auto it = reverse_iterator_type(slots.end()); it != reverse_iterator_type(slots.begin()); ++it)
2708         {
2709           if (it->empty() || it->blocked())
2710             continue;
2711           (sigc::internal::function_pointer_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6, _A_a7);
2712         }
2713     }
2714 #endif // SIGCXX_DISABLE_DEPRECATED
2715 };
2716
2717
2718 } /* namespace internal */
2719
2720 /** Signal declaration.
2721  * signal0 can be used to connect() slots that are invoked
2722  * during subsequent calls to emit(). Any functor or slot
2723  * can be passed into connect(). It is converted into a slot
2724  * implicitly.
2725  *
2726  * If you want to connect one signal to another, use make_slot()
2727  * to retrieve a functor that emits the signal when invoked.
2728  *
2729  * Be careful if you directly pass one signal into the connect()
2730  * method of another: a shallow copy of the signal is made and
2731  * the signal's slots are not disconnected until both the signal
2732  * and its clone are destroyed, which is probably not what you want.
2733  *
2734  * The following template arguments are used:
2735  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
2736  * - @e T_accumulator The accumulator type used for emission. The default
2737  * @p nil means that no accumulator should be used, for example if signal
2738  * emission returns the return value of the last slot invoked.
2739  *
2740  * You should use the more convenient unnumbered sigc::signal template.
2741  *
2742  * @ingroup signal
2743  */
2744 template <class T_return, class T_accumulator=nil>
2745 class signal0
2746   : public signal_base
2747 {
2748 public:
2749   typedef internal::signal_emit0<T_return, T_accumulator> emitter_type;
2750   typedef typename emitter_type::result_type         result_type;
2751   typedef slot<T_return()>    slot_type;
2752   typedef slot_list<slot_type>                       slot_list_type;
2753   typedef typename slot_list_type::iterator               iterator;
2754   typedef typename slot_list_type::const_iterator         const_iterator;
2755   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
2756   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
2757
2758   /** Add a slot to the list of slots.
2759    * Any functor or slot may be passed into connect().
2760    * It will be converted into a slot implicitly.
2761    * The returned iterator may be stored for disconnection
2762    * of the slot at some later point. It stays valid until
2763    * the slot is removed from the list of slots. The iterator
2764    * can also be implicitly converted into a sigc::connection object
2765    * that may be used safely beyond the life time of the slot.
2766    *
2767    * std::function<> and C++11 lambda expressions are functors.
2768    * These are examples of functors that can be connected to a signal.
2769    *
2770    * %std::bind() creates a functor, but this functor typically has an
2771    * %operator()() which is a variadic template.
2772    * Our functor_trait can't deduce the result type
2773    * of such a functor. If you first assign the return value of %std::bind()
2774    * to a std::function, you can connect the std::function to a signal.
2775    *
2776    * @param slot_ The slot to add to the list of slots.
2777    * @return An iterator pointing to the new slot in the list.
2778    */
2779   iterator connect(const slot_type& slot_)
2780     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
2781
2782   /** Add a slot to the list of slots.
2783    * @see connect(const slot_type& slot_).
2784    *
2785    * @newin{2,8}
2786    */
2787   iterator connect(slot_type&& slot_)
2788     { return iterator(signal_base::connect(std::move(static_cast<slot_base&>(slot_)))); }
2789
2790   /** Triggers the emission of the signal.
2791    * During signal emission all slots that have been connected
2792    * to the signal are invoked unless they are manually set into
2793    * a blocking state. The parameters are passed on to the slots.
2794    * If @e T_accumulated is not @p nil, an accumulator of this type
2795    * is used to process the return values of the slot invocations.
2796    * Otherwise, the return value of the last slot invoked is returned.
2797    * @return The accumulated return values of the slot invocations.
2798    */
2799   result_type emit() const
2800     { return emitter_type::emit(impl_); }
2801
2802 #ifndef SIGCXX_DISABLE_DEPRECATED
2803   /** Triggers the emission of the signal in reverse order (see emit()).
2804    *
2805    * @deprecated This is apparently not useful, but please let us know if you need it.
2806    */
2807   result_type emit_reverse() const
2808     { return emitter_type::emit_reverse(impl_); }
2809 #endif // SIGCXX_DISABLE_DEPRECATED
2810
2811   /** Triggers the emission of the signal (see emit()).
2812    *
2813    * @deprecated This is apparently not useful, but let us know if you need it.
2814    */
2815   result_type operator()() const
2816     { return emit(); }
2817
2818   /** Creates a functor that calls emit() on this signal.
2819    * @code
2820    * sigc::mem_fun(mysignal, &sigc::signal0::emit)
2821    * @endcode
2822    * yields the same result.
2823    * @return A functor that calls emit() on this signal.
2824    */
2825   bound_const_mem_functor0<result_type, signal0> make_slot() const
2826     { return bound_const_mem_functor0<result_type, signal0>(*this, &signal0::emit); }
2827
2828 #ifndef SIGCXX_DISABLE_DEPRECATED
2829   /** Creates an STL-style interface for the signal's list of slots.
2830    * This interface supports iteration, insertion and removal of slots.
2831    * @return An STL-style interface for the signal's list of slots.
2832    *
2833    * @deprecated This is apparently not useful, but please let us know if you need it.
2834    */
2835   slot_list_type slots()
2836     { return slot_list_type(impl()); }
2837
2838   /** Creates an STL-style interface for the signal's list of slots.
2839    * This interface supports iteration, insertion and removal of slots.
2840    * @return An STL-style interface for the signal's list of slots.
2841    *
2842    * @deprecated This is apparently not useful, but please let us know if you need it.
2843    */
2844   const slot_list_type slots() const
2845     { return slot_list_type(const_cast<signal0*>(this)->impl()); }
2846 #endif // SIGCXX_DISABLE_DEPRECATED
2847
2848   signal0() {}
2849
2850   signal0(const signal0& src)
2851     : signal_base(src) {}
2852
2853   signal0(signal0&& src)
2854     : signal_base(std::move(src)) {}
2855
2856   signal0& operator=(const signal0& src)
2857   {
2858     signal_base::operator=(src);
2859     return *this;
2860   }
2861
2862   signal0& operator=(signal0&& src)
2863   {
2864     signal_base::operator=(std::move(src));
2865     return *this;
2866   }
2867 };
2868
2869 /** Signal declaration.
2870  * signal1 can be used to connect() slots that are invoked
2871  * during subsequent calls to emit(). Any functor or slot
2872  * can be passed into connect(). It is converted into a slot
2873  * implicitly.
2874  *
2875  * If you want to connect one signal to another, use make_slot()
2876  * to retrieve a functor that emits the signal when invoked.
2877  *
2878  * Be careful if you directly pass one signal into the connect()
2879  * method of another: a shallow copy of the signal is made and
2880  * the signal's slots are not disconnected until both the signal
2881  * and its clone are destroyed, which is probably not what you want.
2882  *
2883  * The following template arguments are used:
2884  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
2885  * - @e T_arg1 Argument type used in the definition of emit().
2886  * - @e T_accumulator The accumulator type used for emission. The default
2887  * @p nil means that no accumulator should be used, for example if signal
2888  * emission returns the return value of the last slot invoked.
2889  *
2890  * You should use the more convenient unnumbered sigc::signal template.
2891  *
2892  * @ingroup signal
2893  */
2894 template <class T_return, class T_arg1, class T_accumulator=nil>
2895 class signal1
2896   : public signal_base
2897 {
2898 public:
2899   typedef internal::signal_emit1<T_return, T_arg1, T_accumulator> emitter_type;
2900   typedef typename emitter_type::result_type         result_type;
2901   typedef slot<T_return(T_arg1)>    slot_type;
2902   typedef slot_list<slot_type>                       slot_list_type;
2903   typedef typename slot_list_type::iterator               iterator;
2904   typedef typename slot_list_type::const_iterator         const_iterator;
2905   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
2906   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
2907
2908   /** Add a slot to the list of slots.
2909    * Any functor or slot may be passed into connect().
2910    * It will be converted into a slot implicitly.
2911    * The returned iterator may be stored for disconnection
2912    * of the slot at some later point. It stays valid until
2913    * the slot is removed from the list of slots. The iterator
2914    * can also be implicitly converted into a sigc::connection object
2915    * that may be used safely beyond the life time of the slot.
2916    *
2917    * std::function<> and C++11 lambda expressions are functors.
2918    * These are examples of functors that can be connected to a signal.
2919    *
2920    * %std::bind() creates a functor, but this functor typically has an
2921    * %operator()() which is a variadic template.
2922    * Our functor_trait can't deduce the result type
2923    * of such a functor. If you first assign the return value of %std::bind()
2924    * to a std::function, you can connect the std::function to a signal.
2925    *
2926    * @param slot_ The slot to add to the list of slots.
2927    * @return An iterator pointing to the new slot in the list.
2928    */
2929   iterator connect(const slot_type& slot_)
2930     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
2931
2932   /** Add a slot to the list of slots.
2933    * @see connect(const slot_type& slot_).
2934    *
2935    * @newin{2,8}
2936    */
2937   iterator connect(slot_type&& slot_)
2938     { return iterator(signal_base::connect(std::move(static_cast<slot_base&>(slot_)))); }
2939
2940   /** Triggers the emission of the signal.
2941    * During signal emission all slots that have been connected
2942    * to the signal are invoked unless they are manually set into
2943    * a blocking state. The parameters are passed on to the slots.
2944    * If @e T_accumulated is not @p nil, an accumulator of this type
2945    * is used to process the return values of the slot invocations.
2946    * Otherwise, the return value of the last slot invoked is returned.
2947    * @param _A_a1 Argument to be passed on to the slots.
2948    * @return The accumulated return values of the slot invocations.
2949    */
2950   result_type emit(type_trait_take_t<T_arg1> _A_a1) const
2951     { return emitter_type::emit(impl_, _A_a1); }
2952
2953 #ifndef SIGCXX_DISABLE_DEPRECATED
2954   /** Triggers the emission of the signal in reverse order (see emit()).
2955    *
2956    * @deprecated This is apparently not useful, but please let us know if you need it.
2957    */
2958   result_type emit_reverse(type_trait_take_t<T_arg1> _A_a1) const
2959     { return emitter_type::emit_reverse(impl_, _A_a1); }
2960 #endif // SIGCXX_DISABLE_DEPRECATED
2961
2962   /** Triggers the emission of the signal (see emit()).
2963    *
2964    * @deprecated This is apparently not useful, but let us know if you need it.
2965    */
2966   result_type operator()(type_trait_take_t<T_arg1> _A_a1) const
2967     { return emit(_A_a1); }
2968
2969   /** Creates a functor that calls emit() on this signal.
2970    * @code
2971    * sigc::mem_fun(mysignal, &sigc::signal1::emit)
2972    * @endcode
2973    * yields the same result.
2974    * @return A functor that calls emit() on this signal.
2975    */
2976   bound_const_mem_functor1<result_type, signal1, type_trait_take_t<T_arg1>> make_slot() const
2977     { return bound_const_mem_functor1<result_type, signal1, type_trait_take_t<T_arg1>>(*this, &signal1::emit); }
2978
2979 #ifndef SIGCXX_DISABLE_DEPRECATED
2980   /** Creates an STL-style interface for the signal's list of slots.
2981    * This interface supports iteration, insertion and removal of slots.
2982    * @return An STL-style interface for the signal's list of slots.
2983    *
2984    * @deprecated This is apparently not useful, but please let us know if you need it.
2985    */
2986   slot_list_type slots()
2987     { return slot_list_type(impl()); }
2988
2989   /** Creates an STL-style interface for the signal's list of slots.
2990    * This interface supports iteration, insertion and removal of slots.
2991    * @return An STL-style interface for the signal's list of slots.
2992    *
2993    * @deprecated This is apparently not useful, but please let us know if you need it.
2994    */
2995   const slot_list_type slots() const
2996     { return slot_list_type(const_cast<signal1*>(this)->impl()); }
2997 #endif // SIGCXX_DISABLE_DEPRECATED
2998
2999   signal1() {}
3000
3001   signal1(const signal1& src)
3002     : signal_base(src) {}
3003
3004   signal1(signal1&& src)
3005     : signal_base(std::move(src)) {}
3006
3007   signal1& operator=(const signal1& src)
3008   {
3009     signal_base::operator=(src);
3010     return *this;
3011   }
3012
3013   signal1& operator=(signal1&& src)
3014   {
3015     signal_base::operator=(std::move(src));
3016     return *this;
3017   }
3018 };
3019
3020 /** Signal declaration.
3021  * signal2 can be used to connect() slots that are invoked
3022  * during subsequent calls to emit(). Any functor or slot
3023  * can be passed into connect(). It is converted into a slot
3024  * implicitly.
3025  *
3026  * If you want to connect one signal to another, use make_slot()
3027  * to retrieve a functor that emits the signal when invoked.
3028  *
3029  * Be careful if you directly pass one signal into the connect()
3030  * method of another: a shallow copy of the signal is made and
3031  * the signal's slots are not disconnected until both the signal
3032  * and its clone are destroyed, which is probably not what you want.
3033  *
3034  * The following template arguments are used:
3035  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
3036  * - @e T_arg1 Argument type used in the definition of emit().
3037  * - @e T_arg2 Argument type used in the definition of emit().
3038  * - @e T_accumulator The accumulator type used for emission. The default
3039  * @p nil means that no accumulator should be used, for example if signal
3040  * emission returns the return value of the last slot invoked.
3041  *
3042  * You should use the more convenient unnumbered sigc::signal template.
3043  *
3044  * @ingroup signal
3045  */
3046 template <class T_return, class T_arg1, class T_arg2, class T_accumulator=nil>
3047 class signal2
3048   : public signal_base
3049 {
3050 public:
3051   typedef internal::signal_emit2<T_return, T_arg1, T_arg2, T_accumulator> emitter_type;
3052   typedef typename emitter_type::result_type         result_type;
3053   typedef slot<T_return(T_arg1, T_arg2)>    slot_type;
3054   typedef slot_list<slot_type>                       slot_list_type;
3055   typedef typename slot_list_type::iterator               iterator;
3056   typedef typename slot_list_type::const_iterator         const_iterator;
3057   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
3058   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
3059
3060   /** Add a slot to the list of slots.
3061    * Any functor or slot may be passed into connect().
3062    * It will be converted into a slot implicitly.
3063    * The returned iterator may be stored for disconnection
3064    * of the slot at some later point. It stays valid until
3065    * the slot is removed from the list of slots. The iterator
3066    * can also be implicitly converted into a sigc::connection object
3067    * that may be used safely beyond the life time of the slot.
3068    *
3069    * std::function<> and C++11 lambda expressions are functors.
3070    * These are examples of functors that can be connected to a signal.
3071    *
3072    * %std::bind() creates a functor, but this functor typically has an
3073    * %operator()() which is a variadic template.
3074    * Our functor_trait can't deduce the result type
3075    * of such a functor. If you first assign the return value of %std::bind()
3076    * to a std::function, you can connect the std::function to a signal.
3077    *
3078    * @param slot_ The slot to add to the list of slots.
3079    * @return An iterator pointing to the new slot in the list.
3080    */
3081   iterator connect(const slot_type& slot_)
3082     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
3083
3084   /** Add a slot to the list of slots.
3085    * @see connect(const slot_type& slot_).
3086    *
3087    * @newin{2,8}
3088    */
3089   iterator connect(slot_type&& slot_)
3090     { return iterator(signal_base::connect(std::move(static_cast<slot_base&>(slot_)))); }
3091
3092   /** Triggers the emission of the signal.
3093    * During signal emission all slots that have been connected
3094    * to the signal are invoked unless they are manually set into
3095    * a blocking state. The parameters are passed on to the slots.
3096    * If @e T_accumulated is not @p nil, an accumulator of this type
3097    * is used to process the return values of the slot invocations.
3098    * Otherwise, the return value of the last slot invoked is returned.
3099    * @param _A_a1 Argument to be passed on to the slots.
3100    * @param _A_a2 Argument to be passed on to the slots.
3101    * @return The accumulated return values of the slot invocations.
3102    */
3103   result_type emit(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2) const
3104     { return emitter_type::emit(impl_, _A_a1, _A_a2); }
3105
3106 #ifndef SIGCXX_DISABLE_DEPRECATED
3107   /** Triggers the emission of the signal in reverse order (see emit()).
3108    *
3109    * @deprecated This is apparently not useful, but please let us know if you need it.
3110    */
3111   result_type emit_reverse(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2) const
3112     { return emitter_type::emit_reverse(impl_, _A_a1, _A_a2); }
3113 #endif // SIGCXX_DISABLE_DEPRECATED
3114
3115   /** Triggers the emission of the signal (see emit()).
3116    *
3117    * @deprecated This is apparently not useful, but let us know if you need it.
3118    */
3119   result_type operator()(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2) const
3120     { return emit(_A_a1, _A_a2); }
3121
3122   /** Creates a functor that calls emit() on this signal.
3123    * @code
3124    * sigc::mem_fun(mysignal, &sigc::signal2::emit)
3125    * @endcode
3126    * yields the same result.
3127    * @return A functor that calls emit() on this signal.
3128    */
3129   bound_const_mem_functor2<result_type, signal2, type_trait_take_t<T_arg1>, type_trait_take_t<T_arg2>> make_slot() const
3130     { return bound_const_mem_functor2<result_type, signal2, type_trait_take_t<T_arg1>, type_trait_take_t<T_arg2>>(*this, &signal2::emit); }
3131
3132 #ifndef SIGCXX_DISABLE_DEPRECATED
3133   /** Creates an STL-style interface for the signal's list of slots.
3134    * This interface supports iteration, insertion and removal of slots.
3135    * @return An STL-style interface for the signal's list of slots.
3136    *
3137    * @deprecated This is apparently not useful, but please let us know if you need it.
3138    */
3139   slot_list_type slots()
3140     { return slot_list_type(impl()); }
3141
3142   /** Creates an STL-style interface for the signal's list of slots.
3143    * This interface supports iteration, insertion and removal of slots.
3144    * @return An STL-style interface for the signal's list of slots.
3145    *
3146    * @deprecated This is apparently not useful, but please let us know if you need it.
3147    */
3148   const slot_list_type slots() const
3149     { return slot_list_type(const_cast<signal2*>(this)->impl()); }
3150 #endif // SIGCXX_DISABLE_DEPRECATED
3151
3152   signal2() {}
3153
3154   signal2(const signal2& src)
3155     : signal_base(src) {}
3156
3157   signal2(signal2&& src)
3158     : signal_base(std::move(src)) {}
3159
3160   signal2& operator=(const signal2& src)
3161   {
3162     signal_base::operator=(src);
3163     return *this;
3164   }
3165
3166   signal2& operator=(signal2&& src)
3167   {
3168     signal_base::operator=(std::move(src));
3169     return *this;
3170   }
3171 };
3172
3173 /** Signal declaration.
3174  * signal3 can be used to connect() slots that are invoked
3175  * during subsequent calls to emit(). Any functor or slot
3176  * can be passed into connect(). It is converted into a slot
3177  * implicitly.
3178  *
3179  * If you want to connect one signal to another, use make_slot()
3180  * to retrieve a functor that emits the signal when invoked.
3181  *
3182  * Be careful if you directly pass one signal into the connect()
3183  * method of another: a shallow copy of the signal is made and
3184  * the signal's slots are not disconnected until both the signal
3185  * and its clone are destroyed, which is probably not what you want.
3186  *
3187  * The following template arguments are used:
3188  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
3189  * - @e T_arg1 Argument type used in the definition of emit().
3190  * - @e T_arg2 Argument type used in the definition of emit().
3191  * - @e T_arg3 Argument type used in the definition of emit().
3192  * - @e T_accumulator The accumulator type used for emission. The default
3193  * @p nil means that no accumulator should be used, for example if signal
3194  * emission returns the return value of the last slot invoked.
3195  *
3196  * You should use the more convenient unnumbered sigc::signal template.
3197  *
3198  * @ingroup signal
3199  */
3200 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_accumulator=nil>
3201 class signal3
3202   : public signal_base
3203 {
3204 public:
3205   typedef internal::signal_emit3<T_return, T_arg1, T_arg2, T_arg3, T_accumulator> emitter_type;
3206   typedef typename emitter_type::result_type         result_type;
3207   typedef slot<T_return(T_arg1, T_arg2, T_arg3)>    slot_type;
3208   typedef slot_list<slot_type>                       slot_list_type;
3209   typedef typename slot_list_type::iterator               iterator;
3210   typedef typename slot_list_type::const_iterator         const_iterator;
3211   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
3212   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
3213
3214   /** Add a slot to the list of slots.
3215    * Any functor or slot may be passed into connect().
3216    * It will be converted into a slot implicitly.
3217    * The returned iterator may be stored for disconnection
3218    * of the slot at some later point. It stays valid until
3219    * the slot is removed from the list of slots. The iterator
3220    * can also be implicitly converted into a sigc::connection object
3221    * that may be used safely beyond the life time of the slot.
3222    *
3223    * std::function<> and C++11 lambda expressions are functors.
3224    * These are examples of functors that can be connected to a signal.
3225    *
3226    * %std::bind() creates a functor, but this functor typically has an
3227    * %operator()() which is a variadic template.
3228    * Our functor_trait can't deduce the result type
3229    * of such a functor. If you first assign the return value of %std::bind()
3230    * to a std::function, you can connect the std::function to a signal.
3231    *
3232    * @param slot_ The slot to add to the list of slots.
3233    * @return An iterator pointing to the new slot in the list.
3234    */
3235   iterator connect(const slot_type& slot_)
3236     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
3237
3238   /** Add a slot to the list of slots.
3239    * @see connect(const slot_type& slot_).
3240    *
3241    * @newin{2,8}
3242    */
3243   iterator connect(slot_type&& slot_)
3244     { return iterator(signal_base::connect(std::move(static_cast<slot_base&>(slot_)))); }
3245
3246   /** Triggers the emission of the signal.
3247    * During signal emission all slots that have been connected
3248    * to the signal are invoked unless they are manually set into
3249    * a blocking state. The parameters are passed on to the slots.
3250    * If @e T_accumulated is not @p nil, an accumulator of this type
3251    * is used to process the return values of the slot invocations.
3252    * Otherwise, the return value of the last slot invoked is returned.
3253    * @param _A_a1 Argument to be passed on to the slots.
3254    * @param _A_a2 Argument to be passed on to the slots.
3255    * @param _A_a3 Argument to be passed on to the slots.
3256    * @return The accumulated return values of the slot invocations.
3257    */
3258   result_type emit(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3) const
3259     { return emitter_type::emit(impl_, _A_a1, _A_a2, _A_a3); }
3260
3261 #ifndef SIGCXX_DISABLE_DEPRECATED
3262   /** Triggers the emission of the signal in reverse order (see emit()).
3263    *
3264    * @deprecated This is apparently not useful, but please let us know if you need it.
3265    */
3266   result_type emit_reverse(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3) const
3267     { return emitter_type::emit_reverse(impl_, _A_a1, _A_a2, _A_a3); }
3268 #endif // SIGCXX_DISABLE_DEPRECATED
3269
3270   /** Triggers the emission of the signal (see emit()).
3271    *
3272    * @deprecated This is apparently not useful, but let us know if you need it.
3273    */
3274   result_type operator()(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3) const
3275     { return emit(_A_a1, _A_a2, _A_a3); }
3276
3277   /** Creates a functor that calls emit() on this signal.
3278    * @code
3279    * sigc::mem_fun(mysignal, &sigc::signal3::emit)
3280    * @endcode
3281    * yields the same result.
3282    * @return A functor that calls emit() on this signal.
3283    */
3284   bound_const_mem_functor3<result_type, signal3, type_trait_take_t<T_arg1>, type_trait_take_t<T_arg2>, type_trait_take_t<T_arg3>> make_slot() const
3285     { return bound_const_mem_functor3<result_type, signal3, type_trait_take_t<T_arg1>, type_trait_take_t<T_arg2>, type_trait_take_t<T_arg3>>(*this, &signal3::emit); }
3286
3287 #ifndef SIGCXX_DISABLE_DEPRECATED
3288   /** Creates an STL-style interface for the signal's list of slots.
3289    * This interface supports iteration, insertion and removal of slots.
3290    * @return An STL-style interface for the signal's list of slots.
3291    *
3292    * @deprecated This is apparently not useful, but please let us know if you need it.
3293    */
3294   slot_list_type slots()
3295     { return slot_list_type(impl()); }
3296
3297   /** Creates an STL-style interface for the signal's list of slots.
3298    * This interface supports iteration, insertion and removal of slots.
3299    * @return An STL-style interface for the signal's list of slots.
3300    *
3301    * @deprecated This is apparently not useful, but please let us know if you need it.
3302    */
3303   const slot_list_type slots() const
3304     { return slot_list_type(const_cast<signal3*>(this)->impl()); }
3305 #endif // SIGCXX_DISABLE_DEPRECATED
3306
3307   signal3() {}
3308
3309   signal3(const signal3& src)
3310     : signal_base(src) {}
3311
3312   signal3(signal3&& src)
3313     : signal_base(std::move(src)) {}
3314
3315   signal3& operator=(const signal3& src)
3316   {
3317     signal_base::operator=(src);
3318     return *this;
3319   }
3320
3321   signal3& operator=(signal3&& src)
3322   {
3323     signal_base::operator=(std::move(src));
3324     return *this;
3325   }
3326 };
3327
3328 /** Signal declaration.
3329  * signal4 can be used to connect() slots that are invoked
3330  * during subsequent calls to emit(). Any functor or slot
3331  * can be passed into connect(). It is converted into a slot
3332  * implicitly.
3333  *
3334  * If you want to connect one signal to another, use make_slot()
3335  * to retrieve a functor that emits the signal when invoked.
3336  *
3337  * Be careful if you directly pass one signal into the connect()
3338  * method of another: a shallow copy of the signal is made and
3339  * the signal's slots are not disconnected until both the signal
3340  * and its clone are destroyed, which is probably not what you want.
3341  *
3342  * The following template arguments are used:
3343  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
3344  * - @e T_arg1 Argument type used in the definition of emit().
3345  * - @e T_arg2 Argument type used in the definition of emit().
3346  * - @e T_arg3 Argument type used in the definition of emit().
3347  * - @e T_arg4 Argument type used in the definition of emit().
3348  * - @e T_accumulator The accumulator type used for emission. The default
3349  * @p nil means that no accumulator should be used, for example if signal
3350  * emission returns the return value of the last slot invoked.
3351  *
3352  * You should use the more convenient unnumbered sigc::signal template.
3353  *
3354  * @ingroup signal
3355  */
3356 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_accumulator=nil>
3357 class signal4
3358   : public signal_base
3359 {
3360 public:
3361   typedef internal::signal_emit4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_accumulator> emitter_type;
3362   typedef typename emitter_type::result_type         result_type;
3363   typedef slot<T_return(T_arg1, T_arg2, T_arg3, T_arg4)>    slot_type;
3364   typedef slot_list<slot_type>                       slot_list_type;
3365   typedef typename slot_list_type::iterator               iterator;
3366   typedef typename slot_list_type::const_iterator         const_iterator;
3367   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
3368   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
3369
3370   /** Add a slot to the list of slots.
3371    * Any functor or slot may be passed into connect().
3372    * It will be converted into a slot implicitly.
3373    * The returned iterator may be stored for disconnection
3374    * of the slot at some later point. It stays valid until
3375    * the slot is removed from the list of slots. The iterator
3376    * can also be implicitly converted into a sigc::connection object
3377    * that may be used safely beyond the life time of the slot.
3378    *
3379    * std::function<> and C++11 lambda expressions are functors.
3380    * These are examples of functors that can be connected to a signal.
3381    *
3382    * %std::bind() creates a functor, but this functor typically has an
3383    * %operator()() which is a variadic template.
3384    * Our functor_trait can't deduce the result type
3385    * of such a functor. If you first assign the return value of %std::bind()
3386    * to a std::function, you can connect the std::function to a signal.
3387    *
3388    * @param slot_ The slot to add to the list of slots.
3389    * @return An iterator pointing to the new slot in the list.
3390    */
3391   iterator connect(const slot_type& slot_)
3392     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
3393
3394   /** Add a slot to the list of slots.
3395    * @see connect(const slot_type& slot_).
3396    *
3397    * @newin{2,8}
3398    */
3399   iterator connect(slot_type&& slot_)
3400     { return iterator(signal_base::connect(std::move(static_cast<slot_base&>(slot_)))); }
3401
3402   /** Triggers the emission of the signal.
3403    * During signal emission all slots that have been connected
3404    * to the signal are invoked unless they are manually set into
3405    * a blocking state. The parameters are passed on to the slots.
3406    * If @e T_accumulated is not @p nil, an accumulator of this type
3407    * is used to process the return values of the slot invocations.
3408    * Otherwise, the return value of the last slot invoked is returned.
3409    * @param _A_a1 Argument to be passed on to the slots.
3410    * @param _A_a2 Argument to be passed on to the slots.
3411    * @param _A_a3 Argument to be passed on to the slots.
3412    * @param _A_a4 Argument to be passed on to the slots.
3413    * @return The accumulated return values of the slot invocations.
3414    */
3415   result_type emit(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4) const
3416     { return emitter_type::emit(impl_, _A_a1, _A_a2, _A_a3, _A_a4); }
3417
3418 #ifndef SIGCXX_DISABLE_DEPRECATED
3419   /** Triggers the emission of the signal in reverse order (see emit()).
3420    *
3421    * @deprecated This is apparently not useful, but please let us know if you need it.
3422    */
3423   result_type emit_reverse(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4) const
3424     { return emitter_type::emit_reverse(impl_, _A_a1, _A_a2, _A_a3, _A_a4); }
3425 #endif // SIGCXX_DISABLE_DEPRECATED
3426
3427   /** Triggers the emission of the signal (see emit()).
3428    *
3429    * @deprecated This is apparently not useful, but let us know if you need it.
3430    */
3431   result_type operator()(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4) const
3432     { return emit(_A_a1, _A_a2, _A_a3, _A_a4); }
3433
3434   /** Creates a functor that calls emit() on this signal.
3435    * @code
3436    * sigc::mem_fun(mysignal, &sigc::signal4::emit)
3437    * @endcode
3438    * yields the same result.
3439    * @return A functor that calls emit() on this signal.
3440    */
3441   bound_const_mem_functor4<result_type, signal4, type_trait_take_t<T_arg1>, type_trait_take_t<T_arg2>, type_trait_take_t<T_arg3>, type_trait_take_t<T_arg4>> make_slot() const
3442     { return bound_const_mem_functor4<result_type, signal4, type_trait_take_t<T_arg1>, type_trait_take_t<T_arg2>, type_trait_take_t<T_arg3>, type_trait_take_t<T_arg4>>(*this, &signal4::emit); }
3443
3444 #ifndef SIGCXX_DISABLE_DEPRECATED
3445   /** Creates an STL-style interface for the signal's list of slots.
3446    * This interface supports iteration, insertion and removal of slots.
3447    * @return An STL-style interface for the signal's list of slots.
3448    *
3449    * @deprecated This is apparently not useful, but please let us know if you need it.
3450    */
3451   slot_list_type slots()
3452     { return slot_list_type(impl()); }
3453
3454   /** Creates an STL-style interface for the signal's list of slots.
3455    * This interface supports iteration, insertion and removal of slots.
3456    * @return An STL-style interface for the signal's list of slots.
3457    *
3458    * @deprecated This is apparently not useful, but please let us know if you need it.
3459    */
3460   const slot_list_type slots() const
3461     { return slot_list_type(const_cast<signal4*>(this)->impl()); }
3462 #endif // SIGCXX_DISABLE_DEPRECATED
3463
3464   signal4() {}
3465
3466   signal4(const signal4& src)
3467     : signal_base(src) {}
3468
3469   signal4(signal4&& src)
3470     : signal_base(std::move(src)) {}
3471
3472   signal4& operator=(const signal4& src)
3473   {
3474     signal_base::operator=(src);
3475     return *this;
3476   }
3477
3478   signal4& operator=(signal4&& src)
3479   {
3480     signal_base::operator=(std::move(src));
3481     return *this;
3482   }
3483 };
3484
3485 /** Signal declaration.
3486  * signal5 can be used to connect() slots that are invoked
3487  * during subsequent calls to emit(). Any functor or slot
3488  * can be passed into connect(). It is converted into a slot
3489  * implicitly.
3490  *
3491  * If you want to connect one signal to another, use make_slot()
3492  * to retrieve a functor that emits the signal when invoked.
3493  *
3494  * Be careful if you directly pass one signal into the connect()
3495  * method of another: a shallow copy of the signal is made and
3496  * the signal's slots are not disconnected until both the signal
3497  * and its clone are destroyed, which is probably not what you want.
3498  *
3499  * The following template arguments are used:
3500  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
3501  * - @e T_arg1 Argument type used in the definition of emit().
3502  * - @e T_arg2 Argument type used in the definition of emit().
3503  * - @e T_arg3 Argument type used in the definition of emit().
3504  * - @e T_arg4 Argument type used in the definition of emit().
3505  * - @e T_arg5 Argument type used in the definition of emit().
3506  * - @e T_accumulator The accumulator type used for emission. The default
3507  * @p nil means that no accumulator should be used, for example if signal
3508  * emission returns the return value of the last slot invoked.
3509  *
3510  * You should use the more convenient unnumbered sigc::signal template.
3511  *
3512  * @ingroup signal
3513  */
3514 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5, class T_accumulator=nil>
3515 class signal5
3516   : public signal_base
3517 {
3518 public:
3519   typedef internal::signal_emit5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_accumulator> emitter_type;
3520   typedef typename emitter_type::result_type         result_type;
3521   typedef slot<T_return(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5)>    slot_type;
3522   typedef slot_list<slot_type>                       slot_list_type;
3523   typedef typename slot_list_type::iterator               iterator;
3524   typedef typename slot_list_type::const_iterator         const_iterator;
3525   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
3526   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
3527
3528   /** Add a slot to the list of slots.
3529    * Any functor or slot may be passed into connect().
3530    * It will be converted into a slot implicitly.
3531    * The returned iterator may be stored for disconnection
3532    * of the slot at some later point. It stays valid until
3533    * the slot is removed from the list of slots. The iterator
3534    * can also be implicitly converted into a sigc::connection object
3535    * that may be used safely beyond the life time of the slot.
3536    *
3537    * std::function<> and C++11 lambda expressions are functors.
3538    * These are examples of functors that can be connected to a signal.
3539    *
3540    * %std::bind() creates a functor, but this functor typically has an
3541    * %operator()() which is a variadic template.
3542    * Our functor_trait can't deduce the result type
3543    * of such a functor. If you first assign the return value of %std::bind()
3544    * to a std::function, you can connect the std::function to a signal.
3545    *
3546    * @param slot_ The slot to add to the list of slots.
3547    * @return An iterator pointing to the new slot in the list.
3548    */
3549   iterator connect(const slot_type& slot_)
3550     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
3551
3552   /** Add a slot to the list of slots.
3553    * @see connect(const slot_type& slot_).
3554    *
3555    * @newin{2,8}
3556    */
3557   iterator connect(slot_type&& slot_)
3558     { return iterator(signal_base::connect(std::move(static_cast<slot_base&>(slot_)))); }
3559
3560   /** Triggers the emission of the signal.
3561    * During signal emission all slots that have been connected
3562    * to the signal are invoked unless they are manually set into
3563    * a blocking state. The parameters are passed on to the slots.
3564    * If @e T_accumulated is not @p nil, an accumulator of this type
3565    * is used to process the return values of the slot invocations.
3566    * Otherwise, the return value of the last slot invoked is returned.
3567    * @param _A_a1 Argument to be passed on to the slots.
3568    * @param _A_a2 Argument to be passed on to the slots.
3569    * @param _A_a3 Argument to be passed on to the slots.
3570    * @param _A_a4 Argument to be passed on to the slots.
3571    * @param _A_a5 Argument to be passed on to the slots.
3572    * @return The accumulated return values of the slot invocations.
3573    */
3574   result_type emit(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5) const
3575     { return emitter_type::emit(impl_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5); }
3576
3577 #ifndef SIGCXX_DISABLE_DEPRECATED
3578   /** Triggers the emission of the signal in reverse order (see emit()).
3579    *
3580    * @deprecated This is apparently not useful, but please let us know if you need it.
3581    */
3582   result_type emit_reverse(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5) const
3583     { return emitter_type::emit_reverse(impl_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5); }
3584 #endif // SIGCXX_DISABLE_DEPRECATED
3585
3586   /** Triggers the emission of the signal (see emit()).
3587    *
3588    * @deprecated This is apparently not useful, but let us know if you need it.
3589    */
3590   result_type operator()(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5) const
3591     { return emit(_A_a1, _A_a2, _A_a3, _A_a4, _A_a5); }
3592
3593   /** Creates a functor that calls emit() on this signal.
3594    * @code
3595    * sigc::mem_fun(mysignal, &sigc::signal5::emit)
3596    * @endcode
3597    * yields the same result.
3598    * @return A functor that calls emit() on this signal.
3599    */
3600   bound_const_mem_functor5<result_type, signal5, type_trait_take_t<T_arg1>, type_trait_take_t<T_arg2>, type_trait_take_t<T_arg3>, type_trait_take_t<T_arg4>, type_trait_take_t<T_arg5>> make_slot() const
3601     { return bound_const_mem_functor5<result_type, signal5, type_trait_take_t<T_arg1>, type_trait_take_t<T_arg2>, type_trait_take_t<T_arg3>, type_trait_take_t<T_arg4>, type_trait_take_t<T_arg5>>(*this, &signal5::emit); }
3602
3603 #ifndef SIGCXX_DISABLE_DEPRECATED
3604   /** Creates an STL-style interface for the signal's list of slots.
3605    * This interface supports iteration, insertion and removal of slots.
3606    * @return An STL-style interface for the signal's list of slots.
3607    *
3608    * @deprecated This is apparently not useful, but please let us know if you need it.
3609    */
3610   slot_list_type slots()
3611     { return slot_list_type(impl()); }
3612
3613   /** Creates an STL-style interface for the signal's list of slots.
3614    * This interface supports iteration, insertion and removal of slots.
3615    * @return An STL-style interface for the signal's list of slots.
3616    *
3617    * @deprecated This is apparently not useful, but please let us know if you need it.
3618    */
3619   const slot_list_type slots() const
3620     { return slot_list_type(const_cast<signal5*>(this)->impl()); }
3621 #endif // SIGCXX_DISABLE_DEPRECATED
3622
3623   signal5() {}
3624
3625   signal5(const signal5& src)
3626     : signal_base(src) {}
3627
3628   signal5(signal5&& src)
3629     : signal_base(std::move(src)) {}
3630
3631   signal5& operator=(const signal5& src)
3632   {
3633     signal_base::operator=(src);
3634     return *this;
3635   }
3636
3637   signal5& operator=(signal5&& src)
3638   {
3639     signal_base::operator=(std::move(src));
3640     return *this;
3641   }
3642 };
3643
3644 /** Signal declaration.
3645  * signal6 can be used to connect() slots that are invoked
3646  * during subsequent calls to emit(). Any functor or slot
3647  * can be passed into connect(). It is converted into a slot
3648  * implicitly.
3649  *
3650  * If you want to connect one signal to another, use make_slot()
3651  * to retrieve a functor that emits the signal when invoked.
3652  *
3653  * Be careful if you directly pass one signal into the connect()
3654  * method of another: a shallow copy of the signal is made and
3655  * the signal's slots are not disconnected until both the signal
3656  * and its clone are destroyed, which is probably not what you want.
3657  *
3658  * The following template arguments are used:
3659  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
3660  * - @e T_arg1 Argument type used in the definition of emit().
3661  * - @e T_arg2 Argument type used in the definition of emit().
3662  * - @e T_arg3 Argument type used in the definition of emit().
3663  * - @e T_arg4 Argument type used in the definition of emit().
3664  * - @e T_arg5 Argument type used in the definition of emit().
3665  * - @e T_arg6 Argument type used in the definition of emit().
3666  * - @e T_accumulator The accumulator type used for emission. The default
3667  * @p nil means that no accumulator should be used, for example if signal
3668  * emission returns the return value of the last slot invoked.
3669  *
3670  * You should use the more convenient unnumbered sigc::signal template.
3671  *
3672  * @ingroup signal
3673  */
3674 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5, class T_arg6, class T_accumulator=nil>
3675 class signal6
3676   : public signal_base
3677 {
3678 public:
3679   typedef internal::signal_emit6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_accumulator> emitter_type;
3680   typedef typename emitter_type::result_type         result_type;
3681   typedef slot<T_return(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6)>    slot_type;
3682   typedef slot_list<slot_type>                       slot_list_type;
3683   typedef typename slot_list_type::iterator               iterator;
3684   typedef typename slot_list_type::const_iterator         const_iterator;
3685   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
3686   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
3687
3688   /** Add a slot to the list of slots.
3689    * Any functor or slot may be passed into connect().
3690    * It will be converted into a slot implicitly.
3691    * The returned iterator may be stored for disconnection
3692    * of the slot at some later point. It stays valid until
3693    * the slot is removed from the list of slots. The iterator
3694    * can also be implicitly converted into a sigc::connection object
3695    * that may be used safely beyond the life time of the slot.
3696    *
3697    * std::function<> and C++11 lambda expressions are functors.
3698    * These are examples of functors that can be connected to a signal.
3699    *
3700    * %std::bind() creates a functor, but this functor typically has an
3701    * %operator()() which is a variadic template.
3702    * Our functor_trait can't deduce the result type
3703    * of such a functor. If you first assign the return value of %std::bind()
3704    * to a std::function, you can connect the std::function to a signal.
3705    *
3706    * @param slot_ The slot to add to the list of slots.
3707    * @return An iterator pointing to the new slot in the list.
3708    */
3709   iterator connect(const slot_type& slot_)
3710     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
3711
3712   /** Add a slot to the list of slots.
3713    * @see connect(const slot_type& slot_).
3714    *
3715    * @newin{2,8}
3716    */
3717   iterator connect(slot_type&& slot_)
3718     { return iterator(signal_base::connect(std::move(static_cast<slot_base&>(slot_)))); }
3719
3720   /** Triggers the emission of the signal.
3721    * During signal emission all slots that have been connected
3722    * to the signal are invoked unless they are manually set into
3723    * a blocking state. The parameters are passed on to the slots.
3724    * If @e T_accumulated is not @p nil, an accumulator of this type
3725    * is used to process the return values of the slot invocations.
3726    * Otherwise, the return value of the last slot invoked is returned.
3727    * @param _A_a1 Argument to be passed on to the slots.
3728    * @param _A_a2 Argument to be passed on to the slots.
3729    * @param _A_a3 Argument to be passed on to the slots.
3730    * @param _A_a4 Argument to be passed on to the slots.
3731    * @param _A_a5 Argument to be passed on to the slots.
3732    * @param _A_a6 Argument to be passed on to the slots.
3733    * @return The accumulated return values of the slot invocations.
3734    */
3735   result_type emit(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6) const
3736     { return emitter_type::emit(impl_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6); }
3737
3738 #ifndef SIGCXX_DISABLE_DEPRECATED
3739   /** Triggers the emission of the signal in reverse order (see emit()).
3740    *
3741    * @deprecated This is apparently not useful, but please let us know if you need it.
3742    */
3743   result_type emit_reverse(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6) const
3744     { return emitter_type::emit_reverse(impl_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6); }
3745 #endif // SIGCXX_DISABLE_DEPRECATED
3746
3747   /** Triggers the emission of the signal (see emit()).
3748    *
3749    * @deprecated This is apparently not useful, but let us know if you need it.
3750    */
3751   result_type operator()(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6) const
3752     { return emit(_A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6); }
3753
3754   /** Creates a functor that calls emit() on this signal.
3755    * @code
3756    * sigc::mem_fun(mysignal, &sigc::signal6::emit)
3757    * @endcode
3758    * yields the same result.
3759    * @return A functor that calls emit() on this signal.
3760    */
3761   bound_const_mem_functor6<result_type, signal6, type_trait_take_t<T_arg1>, type_trait_take_t<T_arg2>, type_trait_take_t<T_arg3>, type_trait_take_t<T_arg4>, type_trait_take_t<T_arg5>, type_trait_take_t<T_arg6>> make_slot() const
3762     { return bound_const_mem_functor6<result_type, signal6, type_trait_take_t<T_arg1>, type_trait_take_t<T_arg2>, type_trait_take_t<T_arg3>, type_trait_take_t<T_arg4>, type_trait_take_t<T_arg5>, type_trait_take_t<T_arg6>>(*this, &signal6::emit); }
3763
3764 #ifndef SIGCXX_DISABLE_DEPRECATED
3765   /** Creates an STL-style interface for the signal's list of slots.
3766    * This interface supports iteration, insertion and removal of slots.
3767    * @return An STL-style interface for the signal's list of slots.
3768    *
3769    * @deprecated This is apparently not useful, but please let us know if you need it.
3770    */
3771   slot_list_type slots()
3772     { return slot_list_type(impl()); }
3773
3774   /** Creates an STL-style interface for the signal's list of slots.
3775    * This interface supports iteration, insertion and removal of slots.
3776    * @return An STL-style interface for the signal's list of slots.
3777    *
3778    * @deprecated This is apparently not useful, but please let us know if you need it.
3779    */
3780   const slot_list_type slots() const
3781     { return slot_list_type(const_cast<signal6*>(this)->impl()); }
3782 #endif // SIGCXX_DISABLE_DEPRECATED
3783
3784   signal6() {}
3785
3786   signal6(const signal6& src)
3787     : signal_base(src) {}
3788
3789   signal6(signal6&& src)
3790     : signal_base(std::move(src)) {}
3791
3792   signal6& operator=(const signal6& src)
3793   {
3794     signal_base::operator=(src);
3795     return *this;
3796   }
3797
3798   signal6& operator=(signal6&& src)
3799   {
3800     signal_base::operator=(std::move(src));
3801     return *this;
3802   }
3803 };
3804
3805 /** Signal declaration.
3806  * signal7 can be used to connect() slots that are invoked
3807  * during subsequent calls to emit(). Any functor or slot
3808  * can be passed into connect(). It is converted into a slot
3809  * implicitly.
3810  *
3811  * If you want to connect one signal to another, use make_slot()
3812  * to retrieve a functor that emits the signal when invoked.
3813  *
3814  * Be careful if you directly pass one signal into the connect()
3815  * method of another: a shallow copy of the signal is made and
3816  * the signal's slots are not disconnected until both the signal
3817  * and its clone are destroyed, which is probably not what you want.
3818  *
3819  * The following template arguments are used:
3820  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
3821  * - @e T_arg1 Argument type used in the definition of emit().
3822  * - @e T_arg2 Argument type used in the definition of emit().
3823  * - @e T_arg3 Argument type used in the definition of emit().
3824  * - @e T_arg4 Argument type used in the definition of emit().
3825  * - @e T_arg5 Argument type used in the definition of emit().
3826  * - @e T_arg6 Argument type used in the definition of emit().
3827  * - @e T_arg7 Argument type used in the definition of emit().
3828  * - @e T_accumulator The accumulator type used for emission. The default
3829  * @p nil means that no accumulator should be used, for example if signal
3830  * emission returns the return value of the last slot invoked.
3831  *
3832  * You should use the more convenient unnumbered sigc::signal template.
3833  *
3834  * @ingroup signal
3835  */
3836 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5, class T_arg6, class T_arg7, class T_accumulator=nil>
3837 class signal7
3838   : public signal_base
3839 {
3840 public:
3841   typedef internal::signal_emit7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_accumulator> emitter_type;
3842   typedef typename emitter_type::result_type         result_type;
3843   typedef slot<T_return(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7)>    slot_type;
3844   typedef slot_list<slot_type>                       slot_list_type;
3845   typedef typename slot_list_type::iterator               iterator;
3846   typedef typename slot_list_type::const_iterator         const_iterator;
3847   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
3848   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
3849
3850   /** Add a slot to the list of slots.
3851    * Any functor or slot may be passed into connect().
3852    * It will be converted into a slot implicitly.
3853    * The returned iterator may be stored for disconnection
3854    * of the slot at some later point. It stays valid until
3855    * the slot is removed from the list of slots. The iterator
3856    * can also be implicitly converted into a sigc::connection object
3857    * that may be used safely beyond the life time of the slot.
3858    *
3859    * std::function<> and C++11 lambda expressions are functors.
3860    * These are examples of functors that can be connected to a signal.
3861    *
3862    * %std::bind() creates a functor, but this functor typically has an
3863    * %operator()() which is a variadic template.
3864    * Our functor_trait can't deduce the result type
3865    * of such a functor. If you first assign the return value of %std::bind()
3866    * to a std::function, you can connect the std::function to a signal.
3867    *
3868    * @param slot_ The slot to add to the list of slots.
3869    * @return An iterator pointing to the new slot in the list.
3870    */
3871   iterator connect(const slot_type& slot_)
3872     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
3873
3874   /** Add a slot to the list of slots.
3875    * @see connect(const slot_type& slot_).
3876    *
3877    * @newin{2,8}
3878    */
3879   iterator connect(slot_type&& slot_)
3880     { return iterator(signal_base::connect(std::move(static_cast<slot_base&>(slot_)))); }
3881
3882   /** Triggers the emission of the signal.
3883    * During signal emission all slots that have been connected
3884    * to the signal are invoked unless they are manually set into
3885    * a blocking state. The parameters are passed on to the slots.
3886    * If @e T_accumulated is not @p nil, an accumulator of this type
3887    * is used to process the return values of the slot invocations.
3888    * Otherwise, the return value of the last slot invoked is returned.
3889    * @param _A_a1 Argument to be passed on to the slots.
3890    * @param _A_a2 Argument to be passed on to the slots.
3891    * @param _A_a3 Argument to be passed on to the slots.
3892    * @param _A_a4 Argument to be passed on to the slots.
3893    * @param _A_a5 Argument to be passed on to the slots.
3894    * @param _A_a6 Argument to be passed on to the slots.
3895    * @param _A_a7 Argument to be passed on to the slots.
3896    * @return The accumulated return values of the slot invocations.
3897    */
3898   result_type emit(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6, type_trait_take_t<T_arg7> _A_a7) const
3899     { return emitter_type::emit(impl_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6, _A_a7); }
3900
3901 #ifndef SIGCXX_DISABLE_DEPRECATED
3902   /** Triggers the emission of the signal in reverse order (see emit()).
3903    *
3904    * @deprecated This is apparently not useful, but please let us know if you need it.
3905    */
3906   result_type emit_reverse(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6, type_trait_take_t<T_arg7> _A_a7) const
3907     { return emitter_type::emit_reverse(impl_, _A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6, _A_a7); }
3908 #endif // SIGCXX_DISABLE_DEPRECATED
3909
3910   /** Triggers the emission of the signal (see emit()).
3911    *
3912    * @deprecated This is apparently not useful, but let us know if you need it.
3913    */
3914   result_type operator()(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2, type_trait_take_t<T_arg3> _A_a3, type_trait_take_t<T_arg4> _A_a4, type_trait_take_t<T_arg5> _A_a5, type_trait_take_t<T_arg6> _A_a6, type_trait_take_t<T_arg7> _A_a7) const
3915     { return emit(_A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6, _A_a7); }
3916
3917   /** Creates a functor that calls emit() on this signal.
3918    * @code
3919    * sigc::mem_fun(mysignal, &sigc::signal7::emit)
3920    * @endcode
3921    * yields the same result.
3922    * @return A functor that calls emit() on this signal.
3923    */
3924   bound_const_mem_functor7<result_type, signal7, type_trait_take_t<T_arg1>, type_trait_take_t<T_arg2>, type_trait_take_t<T_arg3>, type_trait_take_t<T_arg4>, type_trait_take_t<T_arg5>, type_trait_take_t<T_arg6>, type_trait_take_t<T_arg7>> make_slot() const
3925     { return bound_const_mem_functor7<result_type, signal7, type_trait_take_t<T_arg1>, type_trait_take_t<T_arg2>, type_trait_take_t<T_arg3>, type_trait_take_t<T_arg4>, type_trait_take_t<T_arg5>, type_trait_take_t<T_arg6>, type_trait_take_t<T_arg7>>(*this, &signal7::emit); }
3926
3927 #ifndef SIGCXX_DISABLE_DEPRECATED
3928   /** Creates an STL-style interface for the signal's list of slots.
3929    * This interface supports iteration, insertion and removal of slots.
3930    * @return An STL-style interface for the signal's list of slots.
3931    *
3932    * @deprecated This is apparently not useful, but please let us know if you need it.
3933    */
3934   slot_list_type slots()
3935     { return slot_list_type(impl()); }
3936
3937   /** Creates an STL-style interface for the signal's list of slots.
3938    * This interface supports iteration, insertion and removal of slots.
3939    * @return An STL-style interface for the signal's list of slots.
3940    *
3941    * @deprecated This is apparently not useful, but please let us know if you need it.
3942    */
3943   const slot_list_type slots() const
3944     { return slot_list_type(const_cast<signal7*>(this)->impl()); }
3945 #endif // SIGCXX_DISABLE_DEPRECATED
3946
3947   signal7() {}
3948
3949   signal7(const signal7& src)
3950     : signal_base(src) {}
3951
3952   signal7(signal7&& src)
3953     : signal_base(std::move(src)) {}
3954
3955   signal7& operator=(const signal7& src)
3956   {
3957     signal_base::operator=(src);
3958     return *this;
3959   }
3960
3961   signal7& operator=(signal7&& src)
3962   {
3963     signal_base::operator=(std::move(src));
3964     return *this;
3965   }
3966 };
3967
3968
3969
3970 /** Convenience wrapper for the numbered sigc::signal# templates.
3971  * signal can be used to connect() slots that are invoked
3972  * during subsequent calls to emit(). Any functor or slot
3973  * can be passed into connect(). It is converted into a slot
3974  * implicitly.
3975  *
3976  * If you want to connect one signal to another, use make_slot()
3977  * to retrieve a functor that emits the signal when invoked.
3978  *
3979  * Be careful if you directly pass one signal into the connect()
3980  * method of another: a shallow copy of the signal is made and
3981  * the signal's slots are not disconnected until both the signal
3982  * and its clone are destroyed, which is probably not what you want!
3983  *
3984  * The template arguments determine the function signature of
3985  * the emit() function:
3986  * - @e T_return The desired return type of the emit() function.
3987  * - @e T_arg1 Argument type used in the definition of emit(). The default @p nil means no argument.
3988  * - @e T_arg2 Argument type used in the definition of emit(). The default @p nil means no argument.
3989  * - @e T_arg3 Argument type used in the definition of emit(). The default @p nil means no argument.
3990  * - @e T_arg4 Argument type used in the definition of emit(). The default @p nil means no argument.
3991  * - @e T_arg5 Argument type used in the definition of emit(). The default @p nil means no argument.
3992  * - @e T_arg6 Argument type used in the definition of emit(). The default @p nil means no argument.
3993  * - @e T_arg7 Argument type used in the definition of emit(). The default @p nil means no argument.
3994  *
3995  * To specify an accumulator type the nested class signal::accumulated can be used.
3996  *
3997  * @par Example:
3998  * @code
3999  * void foo(int) {}
4000  * sigc::signal<void, long> sig;
4001  * sig.connect(sigc::ptr_fun(&foo));
4002  * sig.emit(19);
4003  * @endcode
4004  *
4005  * @deprecated Please use the syntax similar to that used by std::function<>:
4006  * @code
4007  * sigc::slot<void(bool, int)> some_slot;
4008  * @endcode
4009  *
4010  * @ingroup signal
4011  */
4012 template <class T_return, class T_arg1 = nil, class T_arg2 = nil, class T_arg3 = nil, class T_arg4 = nil, class T_arg5 = nil, class T_arg6 = nil, class T_arg7 = nil>
4013 class signal
4014   : public signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil>
4015 {
4016 public:
4017   /** Convenience wrapper for the numbered sigc::signal# templates.
4018    * Like sigc::signal but the additional template parameter @e T_accumulator
4019    * defines the accumulator type that should be used.
4020    *
4021    * An accumulator is a functor that uses a pair of special iterators
4022    * to step through a list of slots and calculate a return value
4023    * from the results of the slot invokations. The iterators' operator*()
4024    * executes the slot. The return value is buffered, so that in an expression
4025    * like @code a = (*i) * (*i); @endcode the slot is executed only once.
4026    * The accumulator must define its return value as @p result_type.
4027    * 
4028    * @par Example 1:
4029    * This accumulator calculates the arithmetic mean value:
4030    * @code
4031    * struct arithmetic_mean_accumulator
4032    * {
4033    *   typedef double result_type;
4034    *   template<typename T_iterator>
4035    *   result_type operator()(T_iterator first, T_iterator last) const
4036    *   {
4037    *     result_type value_ = 0;
4038    *     int n_ = 0;
4039    *     for (; first != last; ++first, ++n_)
4040    *       value_ += *first;
4041    *     return value_ / n_;
4042    *   }
4043    * };
4044    * @endcode
4045    *
4046    * @par Example 2:
4047    * This accumulator stops signal emission when a slot returns zero:
4048    * @code
4049    * struct interruptable_accumulator
4050    * {
4051    *   typedef bool result_type;
4052    *   template<typename T_iterator>
4053    *   result_type operator()(T_iterator first, T_iterator last) const
4054    *   {
4055    *     for (; first != last; ++first, ++n_)
4056    *       if (!*first) return false;
4057    *     return true;
4058    *   }
4059    * };
4060    * @endcode
4061    *
4062    * @ingroup signal
4063    */
4064   template <class T_accumulator>
4065   class accumulated
4066     : public signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_accumulator>
4067   {
4068   public:
4069     accumulated() {}
4070     accumulated(const accumulated& src)
4071       : signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_accumulator>(src) {}
4072   };
4073
4074   signal() {}
4075
4076   signal(const signal& src)
4077     : signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil>(src) {}
4078
4079   signal(signal&& src)
4080     : signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil>(std::move(src)) {}
4081
4082   signal& operator=(const signal& src)
4083   {
4084     signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil>::operator=(src);
4085     return *this;
4086   }
4087
4088   signal& operator=(signal&& src)
4089   {
4090     signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil>::operator=(std::move(src));
4091     return *this;
4092   }
4093 };
4094
4095 /**
4096  * This specialization allow use of the  sigc::signal<R(Args...)> syntax,
4097  */
4098 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5, class T_arg6, class T_arg7>
4099 class signal<T_return(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7)>
4100   : public signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil>
4101 {
4102 public:
4103   /** Convenience wrapper for the numbered sigc::signal# templates.
4104    * Like sigc::signal but the additional template parameter @e T_accumulator
4105    * defines the accumulator type that should be used.
4106    *
4107    * An accumulator is a functor that uses a pair of special iterators
4108    * to step through a list of slots and calculate a return value
4109    * from the results of the slot invokations. The iterators' operator*()
4110    * executes the slot. The return value is buffered, so that in an expression
4111    * like @code a = (*i) * (*i); @endcode the slot is executed only once.
4112    * The accumulator must define its return value as @p result_type.
4113    *
4114    * @par Example 1:
4115    * This accumulator calculates the arithmetic mean value:
4116    * @code
4117    * struct arithmetic_mean_accumulator
4118    * {
4119    *   typedef double result_type;
4120    *   template<typename T_iterator>
4121    *   result_type operator()(T_iterator first, T_iterator last) const
4122    *   {
4123    *     result_type value_ = 0;
4124    *     int n_ = 0;
4125    *     for (; first != last; ++first, ++n_)
4126    *       value_ += *first;
4127    *     return value_ / n_;
4128    *   }
4129    * };
4130    * @endcode
4131    *
4132    * @par Example 2:
4133    * This accumulator stops signal emission when a slot returns zero:
4134    * @code
4135    * struct interruptable_accumulator
4136    * {
4137    *   typedef bool result_type;
4138    *   template<typename T_iterator>
4139    *   result_type operator()(T_iterator first, T_iterator last) const
4140    *   {
4141    *     for (; first != last; ++first, ++n_)
4142    *       if (!*first) return false;
4143    *     return true;
4144    *   }
4145    * };
4146    * @endcode
4147    *
4148    * @ingroup signal
4149    */
4150   template <class T_accumulator>
4151   class accumulated
4152     : public signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_accumulator>
4153   {
4154   public:
4155     accumulated() {}
4156     accumulated(const accumulated& src)
4157       : signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_accumulator>(src) {}
4158   };
4159
4160   signal() {}
4161
4162   signal(const signal& src)
4163     : signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil>(src) {}
4164
4165   signal(signal&& src)
4166     : signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil>(std::move(src)) {}
4167
4168   signal& operator=(const signal& src)
4169   {
4170     signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil>::operator=(src);
4171     return *this;
4172   }
4173
4174   signal& operator=(signal&& src)
4175   {
4176     signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil>::operator=(std::move(src));
4177     return *this;
4178   }
4179 };
4180
4181
4182
4183
4184 /** Convenience wrapper for the numbered sigc::signal0 template.
4185  * See the base class for useful methods.
4186  * This is the template specialization of the unnumbered sigc::signal
4187  * template for 0 argument(s).
4188  *
4189  * @deprecated Please use the syntax similar to that used by std::function<>:
4190  * @code
4191  * sigc::slot<void(bool, int)> some_slot;
4192  * @endcode
4193  */
4194 template <class T_return>
4195 class signal <T_return, nil, nil, nil, nil, nil, nil, nil>
4196   : public signal0<T_return, nil>
4197 {
4198 public:
4199
4200   /** Convenience wrapper for the numbered sigc::signal0 template.
4201    * Like sigc::signal but the additional template parameter @e T_accumulator
4202    * defines the accumulator type that should be used.
4203    */
4204   template <class T_accumulator>
4205   class accumulated
4206     : public signal0<T_return, T_accumulator>
4207   {
4208   public:
4209     accumulated() {}
4210     accumulated(const accumulated& src)
4211       : signal0<T_return, T_accumulator>(src) {}
4212   };
4213
4214   signal() {}
4215
4216   signal(const signal& src)
4217     : signal0<T_return, nil>(src) {}
4218
4219   signal(signal&& src)
4220     : signal0<T_return, nil>(std::move(src)) {}
4221
4222   signal& operator=(const signal& src)
4223   {
4224     signal0<T_return, nil>::operator=(src);
4225     return *this;
4226   }
4227
4228   signal& operator=(signal&& src)
4229   {
4230     signal0<T_return, nil>::operator=(std::move(src));
4231     return *this;
4232   }
4233 };
4234
4235 /**
4236  * This specialization allow use of the  sigc::signal<R(Args...)> syntax,
4237  */
4238 template <class T_return>
4239 class signal<T_return()>
4240   : public signal0<T_return, nil>
4241 {
4242 public:
4243
4244   /** Convenience wrapper for the numbered sigc::signal0 template.
4245    * Like sigc::signal but the additional template parameter @e T_accumulator
4246    * defines the accumulator type that should be used.
4247    */
4248   template <class T_accumulator>
4249   class accumulated
4250     : public signal0<T_return, T_accumulator>
4251   {
4252   public:
4253     accumulated() {}
4254     accumulated(const accumulated& src)
4255       : signal0<T_return, T_accumulator>(src) {}
4256   };
4257
4258   signal() {}
4259
4260   signal(const signal& src)
4261     : signal0<T_return, nil>(src) {}
4262
4263   signal(signal&& src)
4264     : signal0<T_return, nil>(std::move(src)) {}
4265
4266   signal& operator=(const signal& src)
4267   {
4268     signal0<T_return, nil>::operator=(src);
4269     return *this;
4270   }
4271
4272   signal& operator=(signal&& src)
4273   {
4274     signal0<T_return, nil>::operator=(std::move(src));
4275     return *this;
4276   }
4277 };
4278
4279
4280
4281 /** Convenience wrapper for the numbered sigc::signal1 template.
4282  * See the base class for useful methods.
4283  * This is the template specialization of the unnumbered sigc::signal
4284  * template for 1 argument(s).
4285  *
4286  * @deprecated Please use the syntax similar to that used by std::function<>:
4287  * @code
4288  * sigc::slot<void(bool, int)> some_slot;
4289  * @endcode
4290  */
4291 template <class T_return, class T_arg1>
4292 class signal <T_return, T_arg1, nil, nil, nil, nil, nil, nil>
4293   : public signal1<T_return, T_arg1, nil>
4294 {
4295 public:
4296
4297   /** Convenience wrapper for the numbered sigc::signal1 template.
4298    * Like sigc::signal but the additional template parameter @e T_accumulator
4299    * defines the accumulator type that should be used.
4300    */
4301   template <class T_accumulator>
4302   class accumulated
4303     : public signal1<T_return, T_arg1, T_accumulator>
4304   {
4305   public:
4306     accumulated() {}
4307     accumulated(const accumulated& src)
4308       : signal1<T_return, T_arg1, T_accumulator>(src) {}
4309   };
4310
4311   signal() {}
4312
4313   signal(const signal& src)
4314     : signal1<T_return, T_arg1, nil>(src) {}
4315
4316   signal(signal&& src)
4317     : signal1<T_return, T_arg1, nil>(std::move(src)) {}
4318
4319   signal& operator=(const signal& src)
4320   {
4321     signal1<T_return, T_arg1, nil>::operator=(src);
4322     return *this;
4323   }
4324
4325   signal& operator=(signal&& src)
4326   {
4327     signal1<T_return, T_arg1, nil>::operator=(std::move(src));
4328     return *this;
4329   }
4330 };
4331
4332 /**
4333  * This specialization allow use of the  sigc::signal<R(Args...)> syntax,
4334  */
4335 template <class T_return, class T_arg1>
4336 class signal<T_return(T_arg1)>
4337   : public signal1<T_return, T_arg1, nil>
4338 {
4339 public:
4340
4341   /** Convenience wrapper for the numbered sigc::signal1 template.
4342    * Like sigc::signal but the additional template parameter @e T_accumulator
4343    * defines the accumulator type that should be used.
4344    */
4345   template <class T_accumulator>
4346   class accumulated
4347     : public signal1<T_return, T_arg1, T_accumulator>
4348   {
4349   public:
4350     accumulated() {}
4351     accumulated(const accumulated& src)
4352       : signal1<T_return, T_arg1, T_accumulator>(src) {}
4353   };
4354
4355   signal() {}
4356
4357   signal(const signal& src)
4358     : signal1<T_return, T_arg1, nil>(src) {}
4359
4360   signal(signal&& src)
4361     : signal1<T_return, T_arg1, nil>(std::move(src)) {}
4362
4363   signal& operator=(const signal& src)
4364   {
4365     signal1<T_return, T_arg1, nil>::operator=(src);
4366     return *this;
4367   }
4368
4369   signal& operator=(signal&& src)
4370   {
4371     signal1<T_return, T_arg1, nil>::operator=(std::move(src));
4372     return *this;
4373   }
4374 };
4375
4376
4377
4378 /** Convenience wrapper for the numbered sigc::signal2 template.
4379  * See the base class for useful methods.
4380  * This is the template specialization of the unnumbered sigc::signal
4381  * template for 2 argument(s).
4382  *
4383  * @deprecated Please use the syntax similar to that used by std::function<>:
4384  * @code
4385  * sigc::slot<void(bool, int)> some_slot;
4386  * @endcode
4387  */
4388 template <class T_return, class T_arg1, class T_arg2>
4389 class signal <T_return, T_arg1, T_arg2, nil, nil, nil, nil, nil>
4390   : public signal2<T_return, T_arg1, T_arg2, nil>
4391 {
4392 public:
4393
4394   /** Convenience wrapper for the numbered sigc::signal2 template.
4395    * Like sigc::signal but the additional template parameter @e T_accumulator
4396    * defines the accumulator type that should be used.
4397    */
4398   template <class T_accumulator>
4399   class accumulated
4400     : public signal2<T_return, T_arg1, T_arg2, T_accumulator>
4401   {
4402   public:
4403     accumulated() {}
4404     accumulated(const accumulated& src)
4405       : signal2<T_return, T_arg1, T_arg2, T_accumulator>(src) {}
4406   };
4407
4408   signal() {}
4409
4410   signal(const signal& src)
4411     : signal2<T_return, T_arg1, T_arg2, nil>(src) {}
4412
4413   signal(signal&& src)
4414     : signal2<T_return, T_arg1, T_arg2, nil>(std::move(src)) {}
4415
4416   signal& operator=(const signal& src)
4417   {
4418     signal2<T_return, T_arg1, T_arg2, nil>::operator=(src);
4419     return *this;
4420   }
4421
4422   signal& operator=(signal&& src)
4423   {
4424     signal2<T_return, T_arg1, T_arg2, nil>::operator=(std::move(src));
4425     return *this;
4426   }
4427 };
4428
4429 /**
4430  * This specialization allow use of the  sigc::signal<R(Args...)> syntax,
4431  */
4432 template <class T_return, class T_arg1, class T_arg2>
4433 class signal<T_return(T_arg1, T_arg2)>
4434   : public signal2<T_return, T_arg1, T_arg2, nil>
4435 {
4436 public:
4437
4438   /** Convenience wrapper for the numbered sigc::signal2 template.
4439    * Like sigc::signal but the additional template parameter @e T_accumulator
4440    * defines the accumulator type that should be used.
4441    */
4442   template <class T_accumulator>
4443   class accumulated
4444     : public signal2<T_return, T_arg1, T_arg2, T_accumulator>
4445   {
4446   public:
4447     accumulated() {}
4448     accumulated(const accumulated& src)
4449       : signal2<T_return, T_arg1, T_arg2, T_accumulator>(src) {}
4450   };
4451
4452   signal() {}
4453
4454   signal(const signal& src)
4455     : signal2<T_return, T_arg1, T_arg2, nil>(src) {}
4456
4457   signal(signal&& src)
4458     : signal2<T_return, T_arg1, T_arg2, nil>(std::move(src)) {}
4459
4460   signal& operator=(const signal& src)
4461   {
4462     signal2<T_return, T_arg1, T_arg2, nil>::operator=(src);
4463     return *this;
4464   }
4465
4466   signal& operator=(signal&& src)
4467   {
4468     signal2<T_return, T_arg1, T_arg2, nil>::operator=(std::move(src));
4469     return *this;
4470   }
4471 };
4472
4473
4474
4475 /** Convenience wrapper for the numbered sigc::signal3 template.
4476  * See the base class for useful methods.
4477  * This is the template specialization of the unnumbered sigc::signal
4478  * template for 3 argument(s).
4479  *
4480  * @deprecated Please use the syntax similar to that used by std::function<>:
4481  * @code
4482  * sigc::slot<void(bool, int)> some_slot;
4483  * @endcode
4484  */
4485 template <class T_return, class T_arg1, class T_arg2, class T_arg3>
4486 class signal <T_return, T_arg1, T_arg2, T_arg3, nil, nil, nil, nil>
4487   : public signal3<T_return, T_arg1, T_arg2, T_arg3, nil>
4488 {
4489 public:
4490
4491   /** Convenience wrapper for the numbered sigc::signal3 template.
4492    * Like sigc::signal but the additional template parameter @e T_accumulator
4493    * defines the accumulator type that should be used.
4494    */
4495   template <class T_accumulator>
4496   class accumulated
4497     : public signal3<T_return, T_arg1, T_arg2, T_arg3, T_accumulator>
4498   {
4499   public:
4500     accumulated() {}
4501     accumulated(const accumulated& src)
4502       : signal3<T_return, T_arg1, T_arg2, T_arg3, T_accumulator>(src) {}
4503   };
4504
4505   signal() {}
4506
4507   signal(const signal& src)
4508     : signal3<T_return, T_arg1, T_arg2, T_arg3, nil>(src) {}
4509
4510   signal(signal&& src)
4511     : signal3<T_return, T_arg1, T_arg2, T_arg3, nil>(std::move(src)) {}
4512
4513   signal& operator=(const signal& src)
4514   {
4515     signal3<T_return, T_arg1, T_arg2, T_arg3, nil>::operator=(src);
4516     return *this;
4517   }
4518
4519   signal& operator=(signal&& src)
4520   {
4521     signal3<T_return, T_arg1, T_arg2, T_arg3, nil>::operator=(std::move(src));
4522     return *this;
4523   }
4524 };
4525
4526 /**
4527  * This specialization allow use of the  sigc::signal<R(Args...)> syntax,
4528  */
4529 template <class T_return, class T_arg1, class T_arg2, class T_arg3>
4530 class signal<T_return(T_arg1, T_arg2, T_arg3)>
4531   : public signal3<T_return, T_arg1, T_arg2, T_arg3, nil>
4532 {
4533 public:
4534
4535   /** Convenience wrapper for the numbered sigc::signal3 template.
4536    * Like sigc::signal but the additional template parameter @e T_accumulator
4537    * defines the accumulator type that should be used.
4538    */
4539   template <class T_accumulator>
4540   class accumulated
4541     : public signal3<T_return, T_arg1, T_arg2, T_arg3, T_accumulator>
4542   {
4543   public:
4544     accumulated() {}
4545     accumulated(const accumulated& src)
4546       : signal3<T_return, T_arg1, T_arg2, T_arg3, T_accumulator>(src) {}
4547   };
4548
4549   signal() {}
4550
4551   signal(const signal& src)
4552     : signal3<T_return, T_arg1, T_arg2, T_arg3, nil>(src) {}
4553
4554   signal(signal&& src)
4555     : signal3<T_return, T_arg1, T_arg2, T_arg3, nil>(std::move(src)) {}
4556
4557   signal& operator=(const signal& src)
4558   {
4559     signal3<T_return, T_arg1, T_arg2, T_arg3, nil>::operator=(src);
4560     return *this;
4561   }
4562
4563   signal& operator=(signal&& src)
4564   {
4565     signal3<T_return, T_arg1, T_arg2, T_arg3, nil>::operator=(std::move(src));
4566     return *this;
4567   }
4568 };
4569
4570
4571
4572 /** Convenience wrapper for the numbered sigc::signal4 template.
4573  * See the base class for useful methods.
4574  * This is the template specialization of the unnumbered sigc::signal
4575  * template for 4 argument(s).
4576  *
4577  * @deprecated Please use the syntax similar to that used by std::function<>:
4578  * @code
4579  * sigc::slot<void(bool, int)> some_slot;
4580  * @endcode
4581  */
4582 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4>
4583 class signal <T_return, T_arg1, T_arg2, T_arg3, T_arg4, nil, nil, nil>
4584   : public signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, nil>
4585 {
4586 public:
4587
4588   /** Convenience wrapper for the numbered sigc::signal4 template.
4589    * Like sigc::signal but the additional template parameter @e T_accumulator
4590    * defines the accumulator type that should be used.
4591    */
4592   template <class T_accumulator>
4593   class accumulated
4594     : public signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_accumulator>
4595   {
4596   public:
4597     accumulated() {}
4598     accumulated(const accumulated& src)
4599       : signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_accumulator>(src) {}
4600   };
4601
4602   signal() {}
4603
4604   signal(const signal& src)
4605     : signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, nil>(src) {}
4606
4607   signal(signal&& src)
4608     : signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, nil>(std::move(src)) {}
4609
4610   signal& operator=(const signal& src)
4611   {
4612     signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, nil>::operator=(src);
4613     return *this;
4614   }
4615
4616   signal& operator=(signal&& src)
4617   {
4618     signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, nil>::operator=(std::move(src));
4619     return *this;
4620   }
4621 };
4622
4623 /**
4624  * This specialization allow use of the  sigc::signal<R(Args...)> syntax,
4625  */
4626 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4>
4627 class signal<T_return(T_arg1, T_arg2, T_arg3, T_arg4)>
4628   : public signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, nil>
4629 {
4630 public:
4631
4632   /** Convenience wrapper for the numbered sigc::signal4 template.
4633    * Like sigc::signal but the additional template parameter @e T_accumulator
4634    * defines the accumulator type that should be used.
4635    */
4636   template <class T_accumulator>
4637   class accumulated
4638     : public signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_accumulator>
4639   {
4640   public:
4641     accumulated() {}
4642     accumulated(const accumulated& src)
4643       : signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_accumulator>(src) {}
4644   };
4645
4646   signal() {}
4647
4648   signal(const signal& src)
4649     : signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, nil>(src) {}
4650
4651   signal(signal&& src)
4652     : signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, nil>(std::move(src)) {}
4653
4654   signal& operator=(const signal& src)
4655   {
4656     signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, nil>::operator=(src);
4657     return *this;
4658   }
4659
4660   signal& operator=(signal&& src)
4661   {
4662     signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, nil>::operator=(std::move(src));
4663     return *this;
4664   }
4665 };
4666
4667
4668
4669 /** Convenience wrapper for the numbered sigc::signal5 template.
4670  * See the base class for useful methods.
4671  * This is the template specialization of the unnumbered sigc::signal
4672  * template for 5 argument(s).
4673  *
4674  * @deprecated Please use the syntax similar to that used by std::function<>:
4675  * @code
4676  * sigc::slot<void(bool, int)> some_slot;
4677  * @endcode
4678  */
4679 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5>
4680 class signal <T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil, nil>
4681   : public signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil>
4682 {
4683 public:
4684
4685   /** Convenience wrapper for the numbered sigc::signal5 template.
4686    * Like sigc::signal but the additional template parameter @e T_accumulator
4687    * defines the accumulator type that should be used.
4688    */
4689   template <class T_accumulator>
4690   class accumulated
4691     : public signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_accumulator>
4692   {
4693   public:
4694     accumulated() {}
4695     accumulated(const accumulated& src)
4696       : signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_accumulator>(src) {}
4697   };
4698
4699   signal() {}
4700
4701   signal(const signal& src)
4702     : signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil>(src) {}
4703
4704   signal(signal&& src)
4705     : signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil>(std::move(src)) {}
4706
4707   signal& operator=(const signal& src)
4708   {
4709     signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil>::operator=(src);
4710     return *this;
4711   }
4712
4713   signal& operator=(signal&& src)
4714   {
4715     signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil>::operator=(std::move(src));
4716     return *this;
4717   }
4718 };
4719
4720 /**
4721  * This specialization allow use of the  sigc::signal<R(Args...)> syntax,
4722  */
4723 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5>
4724 class signal<T_return(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5)>
4725   : public signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil>
4726 {
4727 public:
4728
4729   /** Convenience wrapper for the numbered sigc::signal5 template.
4730    * Like sigc::signal but the additional template parameter @e T_accumulator
4731    * defines the accumulator type that should be used.
4732    */
4733   template <class T_accumulator>
4734   class accumulated
4735     : public signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_accumulator>
4736   {
4737   public:
4738     accumulated() {}
4739     accumulated(const accumulated& src)
4740       : signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_accumulator>(src) {}
4741   };
4742
4743   signal() {}
4744
4745   signal(const signal& src)
4746     : signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil>(src) {}
4747
4748   signal(signal&& src)
4749     : signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil>(std::move(src)) {}
4750
4751   signal& operator=(const signal& src)
4752   {
4753     signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil>::operator=(src);
4754     return *this;
4755   }
4756
4757   signal& operator=(signal&& src)
4758   {
4759     signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil>::operator=(std::move(src));
4760     return *this;
4761   }
4762 };
4763
4764
4765
4766 /** Convenience wrapper for the numbered sigc::signal6 template.
4767  * See the base class for useful methods.
4768  * This is the template specialization of the unnumbered sigc::signal
4769  * template for 6 argument(s).
4770  *
4771  * @deprecated Please use the syntax similar to that used by std::function<>:
4772  * @code
4773  * sigc::slot<void(bool, int)> some_slot;
4774  * @endcode
4775  */
4776 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5, class T_arg6>
4777 class signal <T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil>
4778   : public signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil>
4779 {
4780 public:
4781
4782   /** Convenience wrapper for the numbered sigc::signal6 template.
4783    * Like sigc::signal but the additional template parameter @e T_accumulator
4784    * defines the accumulator type that should be used.
4785    */
4786   template <class T_accumulator>
4787   class accumulated
4788     : public signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_accumulator>
4789   {
4790   public:
4791     accumulated() {}
4792     accumulated(const accumulated& src)
4793       : signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_accumulator>(src) {}
4794   };
4795
4796   signal() {}
4797
4798   signal(const signal& src)
4799     : signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil>(src) {}
4800
4801   signal(signal&& src)
4802     : signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil>(std::move(src)) {}
4803
4804   signal& operator=(const signal& src)
4805   {
4806     signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil>::operator=(src);
4807     return *this;
4808   }
4809
4810   signal& operator=(signal&& src)
4811   {
4812     signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil>::operator=(std::move(src));
4813     return *this;
4814   }
4815 };
4816
4817 /**
4818  * This specialization allow use of the  sigc::signal<R(Args...)> syntax,
4819  */
4820 template <class T_return, class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5, class T_arg6>
4821 class signal<T_return(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6)>
4822   : public signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil>
4823 {
4824 public:
4825
4826   /** Convenience wrapper for the numbered sigc::signal6 template.
4827    * Like sigc::signal but the additional template parameter @e T_accumulator
4828    * defines the accumulator type that should be used.
4829    */
4830   template <class T_accumulator>
4831   class accumulated
4832     : public signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_accumulator>
4833   {
4834   public:
4835     accumulated() {}
4836     accumulated(const accumulated& src)
4837       : signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_accumulator>(src) {}
4838   };
4839
4840   signal() {}
4841
4842   signal(const signal& src)
4843     : signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil>(src) {}
4844
4845   signal(signal&& src)
4846     : signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil>(std::move(src)) {}
4847
4848   signal& operator=(const signal& src)
4849   {
4850     signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil>::operator=(src);
4851     return *this;
4852   }
4853
4854   signal& operator=(signal&& src)
4855   {
4856     signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil>::operator=(std::move(src));
4857     return *this;
4858   }
4859 };
4860
4861
4862
4863
4864 } /* namespace sigc */
4865
4866 #ifdef SIGC_NIL_HAS_BEEN_PUSHED
4867   #undef SIGC_NIL_HAS_BEEN_PUSHED
4868   #pragma pop_macro("nil")
4869 #endif
4870
4871 #endif /* _SIGC_SIGNAL_H_ */