Hello,
this code compiles just fine:
#include
#include <iostream>
// void slot() { std::cout << "No args slot called." << std::endl; }
void slot(int i) { std::cout << "Int " << i << " arg slot called." << std::endl; }
int main(int argc, char **argv)
{
boost::signals2::signal s;
s.connect(&slot);
return 0;
}
However, when I uncomment the slot() function, it does not do so, anymore:
boostsignals.cpp:78:5: error: no matching member function for call to 'connect'
s.connect(&slot);
~~^~~~~~~
/usr/include/boost/signals2/detail/signal_template.hpp:689:18: note: candidate function not viable: no overload of
'slot' matching 'const boost::signals2::signal, boost::function,
boost::signals2::mutex>::slot_type' (aka 'const slot >') for 1st argument
connection connect(const slot_type &slot, connect_position position = at_back)
^
/usr/include/boost/signals2/detail/signal_template.hpp:693:18: note: candidate function not viable: requires at least 2
arguments, but 1 was provided
connection connect(const group_type &group,
^
Is there a way to make it working with overloaded slot functions?
Thanks,
Florian