Re: [gtkmm] libsigc++ 2 API changes



On Friday 13 February 2004 20:23, Murray Cumming wrote:
> Here's some clues about the new libsigc++ API:
> http://cvs.gnome.org/bonsai/cvsblame.cgi?file=%2Fglibmm%2FCHANGES

This says:
"There is a libsigc++ compatibility header. The new, undeprecated, API is 
slightly improved.
- Connecting signal handlers:
    signal_something().connect( SigC::slot(*this, &Something::on_something) );
  should become
    signal_something().connect( sigc::mem_fun(*this,&Something::on_something) );
  or, for non-member methods:
    signal_something().connect( sigc::ptr_fun(*this,&Something::on_something) );"

There is an error here: the last line should be
    signal_something().connect(sigc::ptr_fun(&on_something));
and it is intended for either non-member functions or static member functions, 
and replaces:
    signal_something().connect( SigC::slot(&on_something) );

Leaving this aside, sigc::ptr_fun appears to do the same thing that 
std::ptr_fun does, namely to convert a non-member function or static member 
function to a function object.  If there is a standard library adaptor which 
will do the job, it doesn't seem to me to be desirable to duplicate it - or 
does sigc::ptr_fun to something that std::ptr_fun doesn't, and if so what?

Chris.



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