Re: [sigc] libsigc++-2.0 functor and adaptor names



martin-ml hippogriff de wrote:

You should use the methods sigc::ptr_fun() and sigc::mem_fun().
sigc::slot<> is a structure that has an implicit templated ctor that
converts arbitrary functors (e.g. the ones returned by sigc::ptr_fun()
and sigc::mem_fun()) into a functor with a well-defined parameter
list.

E.g. sigc::signal<void,int>::conect() takes functors of type
sigc::slot<void,int>. A sigc::slot<void,int> instantiation is created
on the fly from the functors you pass into connect(). The type of this
functor might be sigc::pointer_functor<void,int>,
sigc::pointer_functor<void,float>, sigc::bound_mem_functor<void,int> or
any other type on which operator()(int) can be invoked.

Can I just check this - sigc::slot's are what I use in typedefs, as data members, and as functon arguments when implementing an API, and users of the API pass in a sigc::ptr_fun() and sigc::mem_fun() to create those slots. The reason I ask is because I found you can pass a sigc::slot<> as well and it seems to work ok.

Jeff.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]