Re: Dereferencing adaptor?
From: Jonathan Turkanis (technews_at_kangaroologic.com)
Date: 02/07/05
- Next message: Tom Howard: "Classes with the same functionality but not convertible"
- Previous message: deancoo: "Re: STL tutorial..."
- In reply to: Matthias: "Dereferencing adaptor?"
- Next in thread: Matthias: "Re: Dereferencing adaptor?"
- Reply: Matthias: "Re: Dereferencing adaptor?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 7 Feb 2005 15:46:19 -0700
Matthias wrote:
> Now, what if coll is a collection of pointers? The predicate will give
> strange results, because it looks only at addresses.
> So, instead of rewriting the predicate to work with pointers, is there
> some kind of dereferencing adaptor already available, which allows me
> to do this:
>
> partition( coll.begin(), coll.end(), Dereference( Predicate() ) );
>
> or something similar?
Try boost's indirect_iterator:
http://www.boost.org/libs/iterator/doc/indirect_iterator.html
Jonathan
- Next message: Tom Howard: "Classes with the same functionality but not convertible"
- Previous message: deancoo: "Re: STL tutorial..."
- In reply to: Matthias: "Dereferencing adaptor?"
- Next in thread: Matthias: "Re: Dereferencing adaptor?"
- Reply: Matthias: "Re: Dereferencing adaptor?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|