Skip to content

Commit 14d2ed3

Browse files
committed
slot, signal docs: Describe the slot<void(int)> syntax more
See #86
1 parent 540aad2 commit 14d2ed3

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

sigc++/functors/macros/slot.h.m4

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ FOR(1,$1,[
3737
*
3838
* You should use the more convenient unnumbered sigc::slot template.
3939
*
40+
* @deprecated Please use the syntax similar to that used by std::function<>:
41+
* @code
42+
* sigc::slot<void(bool, int)> some_slot;
43+
* @endcode
44+
*
4045
* @ingroup slot
4146
*/
4247
template <LIST(class T_return, LOOP(class T_arg%1, $1))>
@@ -561,7 +566,7 @@ FOR(0,eval(CALL_SIZE-1),[[SLOT(%1,CALL_SIZE)]])
561566
* sigc::slot<void(bool, int)> some_slot;
562567
* @endcode
563568
*
564-
* Alternatively, you may use this syntax:
569+
* Alternatively, you may use this deprecated syntax:
565570
* @code
566571
* sigc::slot<void, bool, int> some_slot;
567572
* @endcode

sigc++/functors/slot_base.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,20 @@ struct SIGC_API slot_do_unbind
186186
*
187187
* Use the sigc::mem_fun() or sigc::ptr_fun() template functions to get a sigc::slot, like so:
188188
* @code
189-
* sigc::slot<void, int> sl = sigc::mem_fun(someobj, &SomeClass::somemethod);
189+
* sigc::slot<void(int)> sl = sigc::mem_fun(someobj, &SomeClass::somemethod);
190190
* @endcode
191191
* or
192192
* @code
193-
* sigc::slot<void, int> sl = sigc::ptr_fun(&somefunction);
193+
* sigc::slot<void(int)> sl = sigc::ptr_fun(&somefunction);
194194
* @endcode
195195
* or, in gtkmm,
196196
* @code
197197
* m_Button.signal_clicked().connect( sigc::mem_fun(*this, &MyWindow::on_button_clicked) );
198198
* @endcode
199+
* Alternatively, you may use this deprecated syntax:
200+
* @code
201+
* sigc::slot<void, int> sl = sigc::mem_fun(someobj, &SomeClass::somemethod);
202+
* @endcode
199203
*
200204
* The compiler will complain if SomeClass::somemethod, etc. have the wrong signature.
201205
*
@@ -211,7 +215,7 @@ struct SIGC_API slot_do_unbind
211215
* sigc::mem_fun() and sigc::ptr_fun() return functors, but those functors are
212216
* not slots.
213217
* @code
214-
* sigc::slot<void, int> sl = sigc::mem_fun(someobj, &SomeClass::somemethod);
218+
* sigc::slot<void(int)> sl = sigc::mem_fun(someobj, &SomeClass::somemethod);
215219
* @endcode
216220
* is not equivalent to
217221
* @code
@@ -237,10 +241,11 @@ struct SIGC_API slot_do_unbind
237241
*
238242
* If you connect a C++11 lambda expression or a std::function<> instance to
239243
* a signal or assign it to a slot,
240-
* - With libsigc++ versions before 2.6, if the return type is not void,
244+
* - with libsigc++ versions before 2.6, if the return type is not void,
241245
you must use the #SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE macro,
242246
* - if your functor contains references to sigc::trackable derived objects,
243-
* those objects will not be tracked, unless you also use sigc::track_obj().
247+
* those objects will not be tracked, unless you also use sigc::track_object()
248+
* or sigc::track_obj().
244249
*
245250
* @ingroup sigcfunctors
246251
*/

sigc++/macros/signal.h.m4

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,11 @@ FOR(1,$1,[
310310
*
311311
* You should use the more convenient unnumbered sigc::signal template.
312312
*
313+
* @deprecated Please use the syntax similar to that used by std::function<>:
314+
* @code
315+
* sigc::signal<void(bool, int)> some_signal;
316+
* @endcode
317+
*
313318
* @ingroup signal
314319
*/
315320
template <LIST(class T_return, LOOP(class T_arg%1, $1), class T_accumulator=nil)>
@@ -474,7 +479,7 @@ FOR(1,$1,[
474479
*
475480
* @deprecated Please use the syntax similar to that used by std::function<>:
476481
* @code
477-
* sigc::slot<void(bool, int)> some_slot;
482+
* sigc::signal<void(bool, int)> some_signal;
478483
* @endcode
479484
*
480485
* @ingroup signal
@@ -489,7 +494,7 @@ class signal],[dnl
489494
*
490495
* @deprecated Please use the syntax similar to that used by std::function<>:
491496
* @code
492-
* sigc::slot<void(bool, int)> some_slot;
497+
* sigc::signal<void(bool, int)> some_signal;
493498
* @endcode
494499
ifelse($1, $2,[dnl
495500
*
@@ -586,7 +591,9 @@ ifelse($1, $2,[dnl
586591
};
587592
588593
/**
589-
* This specialization allow use of the sigc::signal<R(Args...)> syntax,
594+
* This specialization allows use of the sigc::signal<R(Args...)> syntax.
595+
*
596+
* @ingroup signal
590597
*/
591598
template <LIST(class T_return, LOOP(class T_arg%1, $1))>
592599
class signal<T_return(LIST(LOOP(T_arg%1, $1)))>

sigc++/signal_base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ struct temp_slot_list
264264
* class MyClass
265265
* {
266266
* public:
267-
* typedef sigc::signal<void> MySignalType;
267+
* using MySignalType = sigc::signal<void()>;
268268
* MySignalType get_my_signal() { return m_my_signal; }
269269
* private:
270270
* MySignalType m_my_signal;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy