Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-02-27 17:27:36


It's all very well and good to emulate keyword arguments, but shouldn't they
be optional? After all, the type described below is nearly just:

boost::iterator_adaptor<const int*, boost::reverse_iterator_policies>

I realize the type below is more explicit, but it's also a /lot/ more
complex.

-Dave

----- Original Message -----
From: "Jeremy Siek" <jsiek_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Tuesday, February 27, 2001 4:13 PM
Subject: RE: [boost] Iterator Adaptor not using traits as template args

>
> I've been playing around with this idea some more. One idea I've had is
> instead of using the named parameters for just the traits, use it for
> *all* the parameters of iterator_adaptor, wrapping everything in an
> iterator_adaptor_generator. Here's how using it would look:
>
> int* x;
> boost::iterator_adaptor_generator
> ::base<int*>
> ::reference<const int&>
> ::policies<boost::reverse_iterator_policies>
> ::end<>::type iter(x);
>
> The end<> deserves some explaining. It's there so that we only instantiate
> *one* version of the iterator_adaptor, thus saving the compiler LOTS of
> work. One possibility is to add a macro, such as
>
> #define gentype end<>::type
>
> to get rid of the end<> from the user's view. Or if someone can think of
> another way to do this, great!
>
>
> I've attached the implementation for the above... pardon some nasty macro
> stuff... not my expertise.
>
> Cheers,
> Jeremy
>
>
>
> ----------------------------------------------------------------------
> Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
> Ph.D. Candidate email: jsiek_at_[hidden]
> Univ. of Notre Dame work phone: (219) 631-3906
> ----------------------------------------------------------------------
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


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