
Thorsten Ottosen wrote:
"David Abrahams" <dave@boost-consulting.com> wrote in message news:u1xar33ps.fsf@boost-consulting.com...
Matthias Kaeppler <nospam@digitalraid.com> writes:
Thorsten Ottosen wrote:
template< class Fun > class indirect_fun { Fun fun;
This is too specific for Matthias' purposes (doesn't work on containers of iterators or smart pointers). Maybe something like:
template< class Fun > struct indirect_fun { indirect_fun( Fun f ) : fun(f) { }
template< class T > typename result_of<Fun(typename pointee<T>::type)>::type operator()( T const& r ) const { return fun( *r ); }
yeah, this is good stuff, mind if I borrow it?
Wouldn't it be a good thing to use the full result_of "protocol" as specified in the docs (and more specifically in the N1454) ? Regards // Fredrik Blomqvist