Tuesday 25 March 2008
sigc++ and boost::bind
By hub, Tuesday 25 March 2008 at 21:39 :: C++
I have been using Gtkmm a lot for a personal project.
I discovered that you can pass boost::bind
to Gtkmm signals (that use sigc
), thanks to the magic of templates.
Something like that:
m_selection->signal_selected .connect(boost::bind(&LibraryMainView::on_selected, m_mainview, _1));
Why? Because I'm more familiar with Boost.Bind and for me it looks more flexible. Also because you can pass a shared_ptr<>
to it, unlike with sigc::mem_fun
.