Boost logo

Boost :

Subject: Re: [boost] [review] Heaps
From: Andrew Sutton (asutton.list_at_[hidden])
Date: 2011-06-01 12:48:44


>> One of my primary objections to the current design is the use of
>> unspecified policy parameters in the template parameter list of the
>> main data structures. I think that it is important to limit the number
>> of top-level template parameters to only non-policy parameters.
>
> of course this can be discussed ... i somehow like this explicit way of
> specifying parameters, but this is probably my personal preference ...

But they're not explicit; the parameters are entirely too vague. If I
look at the class definition, I should be able to able to generate
some reasonable hypothesis about the kinds of types accepted by the
template parameters.

> i think it would be great to have a clear policy among all (or all new) boost
> libraries ... then this can be discussed once and only once ... i would prefer
> to have clear interface guidelines instead of arguing about personal preferences
> :)

There's a lot of value in having a consistent design style, but trying
to pin one down for all of Boost may be a little bit beyond the scope
of this review :)

I am curious to hear some other opinions on this.

> ... i haven't really worked with c++0x, yet ... but isn't this address by
> variadic templates?

Yes and no. You can certainly support arbitrary policies with variadic
templates (basically a tuple of policies). I built a small
experimental library that did exactly this in 2009. I didn't like the
result because it made the resulting classes so vague.


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