I would like to encapsulate a signals2::signal object ans expose the connect and operator() functions, but how does their prototypes look like?
Example:
#include <boost/signals2/signal.hpp>
template<typename T> class A {
public:
typedef boost::signals2::signal<T> SIG_T;
void connect( TYPE1 arg ){
s.connect(arg);
}
void fire ( TYPE2 arg ){
s(arg);
}
private:
SIG_T s;
};
So how to express the correct type for TYPE1 and TYPE2, I assume it is something like SIG_T::???
connecttakestypename SIG_T::slot_type const &.operator()takestypename SIG_T::argument_type(also defined astypename SIG_T::arg<0>::type).Alternatively, you could use templates to avoid worrying about the exact definition and accept anything convertible to the correct types: