@@ -254,6 +254,74 @@ public:
254
254
}
255
255
};
256
256
257
+
258
+ /** Convenience wrapper for the numbered sigc::slot$1 template.
259
+ * See the base class for useful methods.
260
+ * This is the template specialization of the unnumbered sigc::slot
261
+ * template for $1 argument(s), specialized for different numbers of arguments
262
+ * This is possible because the template has default (nil) template types.
263
+ dnl *
264
+ dnl * @ingroup slot
265
+ *
266
+ * This specialization allow use of the sigc::slot<R(Args...)> syntax,
267
+ */
268
+ template <LIST(class T_return, LOOP(class T_arg%1, $1 ))>
269
+ class slot<T_return(LIST(LOOP(T_arg%1, $1 )))>
270
+ : public slot$1 <LIST(T_return, LOOP(T_arg%1, $1 ))>
271
+ {
272
+ public:
273
+ typedef slot$1 <LIST(T_return, LOOP(T_arg%1, $1 ))> parent_type;
274
+
275
+ inline slot() {}
276
+
277
+ /** Constructs a slot from an arbitrary functor.
278
+ * @param _A_func The desired functor the new slot should be assigned to.
279
+ */
280
+ template <class T_functor>
281
+ slot(const T_functor& _A_func)
282
+ : parent_type(_A_func) {}
283
+
284
+ // Without static_cast parent_type(const T_functor& _A_func)
285
+ // is called instead of the copy constructor.
286
+ /** Constructs a slot, copying an existing one.
287
+ * @param src The existing slot to copy.
288
+ */
289
+ slot(const slot& src)
290
+ : parent_type(static_cast<const parent_type&>(src)) {}
291
+
292
+ // Without static_cast parent_type(const T_functor& _A_func)
293
+ // is called instead of the move constructor.
294
+ /** Constructs a slot, moving an existing one.
295
+ * If @p src is connected to a parent (e.g. a signal), it is copied, not moved.
296
+ * @param src The existing slot to move or copy.
297
+ */
298
+ slot(slot&& src)
299
+ : parent_type(std::move(static_cast<parent_type&>(src))) {}
300
+
301
+ /** Overrides this slot, making a copy from another slot.
302
+ * @param src The slot from which to make a copy.
303
+ * @return @p this.
304
+ */
305
+ slot& operator=(const slot& src)
306
+ {
307
+ parent_type::operator=(src);
308
+ return *this;
309
+ }
310
+
311
+ /** Overrides this slot, making a move from another slot.
312
+ * If @p src is connected to a parent (e.g. a signal), it is copied, not moved.
313
+ * @param src The slot from which to move or copy.
314
+ * @return @p this.
315
+ */
316
+ slot& operator=(slot&& src)
317
+ {
318
+ parent_type::operator=(std::move(src));
319
+ return *this;
320
+ }
321
+ };
322
+
323
+
324
+
257
325
ifelse ( $1 , $2 ,[ dnl
258
326
#ifndef DOXYGEN_SHOULD_SKIP_THIS
259
327
//template specialization of visitor<>::do_visit_each<>(action, functor):
0 commit comments