Imported Upstream version 2.99.2
[platform/upstream/libsigc++.git] / sigc++ / signal.h
index 07edba2..6df4207 100644 (file)
@@ -599,7 +599,7 @@ struct signal_emit
 {
   using self_type = signal_emit<T_return, T_accumulator, T_arg...>;
   using result_type = typename T_accumulator::result_type;
-  using slot_type = slot<T_return, T_arg...>;
+  using slot_type = slot<T_return(T_arg...)>;
   using slot_iterator_buf_type = internal::slot_iterator_buf<self_type, T_return>;
   using slot_reverse_iterator_buf_type = internal::slot_reverse_iterator_buf<self_type, T_return>;
   using iterator_type = signal_impl::const_iterator_type;
@@ -683,7 +683,7 @@ struct signal_emit<T_return, void, T_arg...>
 {
   using self_type = signal_emit<T_return, void, T_arg...>;
   using result_type = T_return;
-  using slot_type = slot<T_return, T_arg...>;
+  using slot_type = slot<T_return(T_arg...)>;
   using iterator_type = signal_impl::const_iterator_type;
   using call_type = typename slot_type::call_type;
 
@@ -774,7 +774,7 @@ struct signal_emit<void, void, T_arg...>
 {
   using self_type = signal_emit<void, void, T_arg...>;
   using result_type = void;
-  using slot_type = slot<void, T_arg...>;
+  using slot_type = slot<void(T_arg...)>;
   using iterator_type = signal_impl::const_iterator_type;
   using call_type = typename slot_type::call_type;
 
@@ -854,7 +854,7 @@ class signal_with_accumulator
 public:
   using emitter_type = internal::signal_emit<T_return, T_accumulator, T_arg...>;
   using result_type = typename emitter_type::result_type;
-  using slot_type = slot<T_return, T_arg...>;
+  using slot_type = slot<T_return(T_arg...)>;
   using slot_list_type = slot_list<slot_type>;
   using iterator = typename slot_list_type::iterator;
   using const_iterator = typename slot_list_type::const_iterator;
@@ -964,8 +964,7 @@ public:
 };
 
 
-/** Convenience wrapper for the numbered sigc::signal# templates.
- * signal can be used to connect() slots that are invoked
+/** signal can be used to connect() slots that are invoked
  * during subsequent calls to emit(). Any functor or slot
  * can be passed into connect(). It is converted into a slot
  * implicitly.
@@ -986,6 +985,12 @@ public:
  * the emit() function:
  * - @e T_return The desired return type of the emit() function. * - @e T_arg Argument types used in the definition of emit().
  *
+ * For instance, to declare a signal whose connected slot returns void and takes
+ * two parameters of bool and int:
+ * @code
+ * sigc::signal<void(bool, int)> some_signal;
+ * @endcode
+ *
  * To specify an accumulator type the nested class signal::accumulated can be used.
  *
  * @par Example:
@@ -999,14 +1004,16 @@ public:
  * @ingroup signal
  */
 template <class T_return, class... T_arg>
-class signal
+class signal;
+
+template <class T_return, class... T_arg>
+class signal<T_return(T_arg...)>
   : public signal_with_accumulator<T_return, void, T_arg...>
 {
 public:
   using accumulator_type = void;
 
-  /** Convenience wrapper for the numbered sigc::signal# templates.
-   * Like sigc::signal but the additional template parameter @e T_accumulator
+  /** Like sigc::signal but the additional template parameter @e T_accumulator
    * defines the accumulator type that should be used.
    *
    * An accumulator is a functor that uses a pair of special iterators
@@ -1015,7 +1022,7 @@ public:
    * executes the slot. The return value is buffered, so that in an expression
    * like @code a = (*i) * (*i); @endcode the slot is executed only once.
    * The accumulator must define its return value as @p result_type.
-   * 
+   *
    * @par Example 1:
    * This accumulator calculates the arithmetic mean value:
    * @code