I tried overloading a function with boost::function with different signatures, it did not work.
I tried using template<Signature> Connection *connect(boost::function<Signature> f)
which also failed because boost::bind doesn't implicitly convert that way
What I'm trying to do is exactly what boost::signals does. Boost signals can accept both, function object without arguments and function objects with N arguments
I want to know how I can accept both type of function objects in one function.
You can use variadic templates:
This will accept both a function that takes 0 arguments or one that accepts N arguments.