[...]
I think this might due to boost::function's templated constructor being unconstrained [1]:
template<typename F> functionN(F);
It looks to me, then, that a void (*)( int ) is, at least superficially, convertible to boost::function< Signature > regardless of Signature (hence the ambiguity), but the body of the converting constructor will only compile if Signature and void ( int ) are compatible. Perhaps worth it to add a boost::enable_if to the functionN constructor to restrict the class of function pointers that can bind to it.
> In the meantime I have found a possible workaround:
> If I change
> typedef boost::function<void(T,const ServerError&)> cb_err_func;
> to
> typedef boost::function<void(const ServerError&,T)> cb_err_func;
> the code does compile.
Okay, never mind, my theory above seem to run counter to this fact :(
- Jeff
[1]
http://www.boost.org/doc/libs/1_49_0/doc/html/boost/functionN.html