Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-06-03 15:35:32


I don't love the _p suffix, but otherwise, this is roughly what I'd
envisioned. I don't see why everything needs to be wrapped and stuck into an
associative list, but I'm not looking at the implementation details here.

Sounds like a reasonable approach to me,
Dave

----- Original Message -----
From: "Jeremy Siek" <jsiek_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Sunday, June 03, 2001 4:21 PM
Subject: [boost] iterator adaptor named parameters

>
> Here's what I think we should do with the iterator adaptor
> named parameters.
>
> Instead of the nested templates scheme, I think we should have the user
> specify the name using a wrapper class for each parameter. The wrapper
> class names would correspond to the parameter name, with something like
> "_p" at the end to mean "parameter" and to avoid name clashes. The usage
> would look like this:
>
> boost::iterator_adaptor<Iter, Policy,
> boost::reference_p<T&>, boost::value_type_p<T> >
>
> The normal non-named parameter usage would still be supported of course.
>
> The implementation creates a type-list out of the parameter wrappers that
> basically acts like an associative list, with the key being a tag class
> that identifies the parameter, and the value being the argument type. When
> an argument is passed in without a wrapper, this is detected and the
> wrapper is added before inserting into the type-list. Then there's some
> meta-code that searches through the type-list for each parameter, and then
> resolve any defaults.
>
> I just finished implementing this approach, seems to work pretty well and
> is a bit simpler than the previous approach, and of course avoid the
> problem of the "template" keyword showing up all over the place.
>
> Does this sound like an acceptable solution?
>
> Cheers,
> Jeremy
>
>
> ----------------------------------------------------------------------
> Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
> Ph.D. Candidate, IU B'ton email: jsiek_at_[hidden]
> Summer Manager, AT&T Research phone: (973) 360-8185
> ----------------------------------------------------------------------
>
>
>
> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
>
>
> 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