
Bruno MartÃnez wrote:
Hi.
When using pointers to functions with bind, the particular function doesn't play a part in the return value's type of bind. That is
void func1(); void func2();
typeid(boost::bind(&func1)) == typeid(boost::bind(&func1)) // this is true
I need the types to be different to store bind objects with the serialization library. The C++ Templates book proposes an adaptor that takes the pointer to function as a template parameter. However, this adaptor is particular to a given signature, and I don't know how to rewrite it more generally. Is this possible? Can I more easily make boost::bind do what I want?
Bruno You may be making more work for yourself than you need to, why do you need to serialize bind objects? I haven't used the serialization lib, but a quick look-through doesn't really bring any times to mind where I would want to serialize a boost::bind functor!