Boost logo

Boost Users :

From: Agoston Bejo (gusz1_at_[hidden])
Date: 2004-12-19 15:01:42


"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:002701c4e5de$abea0e80$6401a8c0_at_pdimov2...
> Agoston Bejo wrote:
> > Hi!
> > Is there an easy way to use the exact type of what boost::bind(...)
> > returns?
>
> The only way to obtain the exact type is to use an intermediate function
> template:
>
> template<class F> void g( F f )
> {
> // use F here
> }
>
> int main()
> {
> g( bind(...) );
> }
>
> > The example above sheds some light of the source of this
> > question. It would be much better (actually this is what bind is for,
> > isn't it?) if I didn't have to define the plus_5 struct in order to be
> > able to use transform_iterator.
>
> In this case, the intermediate function template is already written:
> make_transform_iterator.

That won't do because I am creating a class that has an iterator typedef
which would be some kind of transform_iterator. So the type must explicitly
be stated.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net