
9 Dec
2007
9 Dec
'07
12:47 a.m.
Indeed there is too much type erasure happening here. What is it that you don't like with vector<shared_ptr<somefunctionObject> >?
Hi Matthias, vector<shared_ptr<somefunctionObject> > works fine from a technical point of view, but forces users of this class to provide the call backs in a particular format. That is where boost::function can help, as users can give me call back functions either as function pointers or as function objects, and they can use boost::bind to make some of their own functions fit the requirements of the callback. However, as serialization is a vital requirement of my application, I guess I have to stick with the original vector<shared_ptr> solution. Best Regards, Ruediger Berlich