Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-03-07 13:04:32


"David Abrahams" <dave_at_[hidden]> wrote in message
news:u1xar33ps.fsf_at_boost-consulting.com...
| Matthias Kaeppler <nospam_at_[hidden]> 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?

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk