Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-03-03 17:04:26


Pretty nice!

A few points of potential concern:
1. I don't think cons<> will work as written with MSVC. My experience has
been that you need indirection through a second template to do recursive
templates in VC. You may have a similar problem with make_traits

2. I'm not sure that the scheme will always work because you seem to
instantiate iterator_defaults<Base,Value> regardless of the type of Base. If
Base is int, you're in deep trouble since iterator_defaults uses
iterator_traits<Base>. You need a way to avoid instantiating
iterator_defaults<Base,Value> if it's not actually needed due to the
corresponding traits having been explicitly supplied.

-Dave
----- Original Message -----
From: "Jeremy Siek" <jsiek_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Saturday, March 03, 2001 4:06 PM
Subject: RE: [boost] Named template parameters

>
> Another variation on the named template parameters.
>
> Instead of using :: to separate the parameters, we stick with the more
> traditional comma. This requires some "type wrapper" classes, each with a
> name corresponding to the template parameter.
>
> boost::iterator_adaptor<int*, default_iterator_policies,
> Category<std::input_iterator_tag>, Reference<int>
> >
>
> I then use a technique to turn the list of type wrappers into a
> inheritance chain where each level in the chain adds a typedef such as
> value_type or iterator_category. The "top" of the chain contains the
> defaults. The code isn't all that complicated. I've attached it to this
> email.
>
> 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