
Hi Matthias, "Matthias Kaeppler" <nospam@digitalraid.com> wrote in message news:d0ff4g$7rm$1@sea.gmane.org... | Hello, | | because of the lack of a generic adaptor which indirects operations on | pointers to the pointees, i.e. sorting a collection of pointers with | predicates applying to the pointees, I have come up with two classes, | indirecter_unary and indirecter_binary which do exactly that (thanks | again to the people from boost users and comp.lang.c++ for assisting | me). Both adaptors accept adaptable function objects as well as plain | functions. these classes are useful when we need to use a class; boost.bind won't work since we don't know what type it returns. I have been playing with similar functionality for Boost.Pointer Container because the ptr_set class needs it. I have a question, though. I'm thinking, what is the benefit of your approach compared to template< class Fun > class indirect_fun { Fun fun; public: typedef typename result_of<Fun>::type result; indirect_fun( Fun f ) : fun(f) { } template< class T > result operator( T* r ) const { return fun( *r ); } template< class T, class U > result operator( T* r, U* r2 ) const { return fun( *r, *r2 ); } // etc }; br -Thorsten