|
Boost : |
Subject: Re: [boost] [review] Heaps
From: Andrew Sutton (asutton.list_at_[hidden])
Date: 2011-06-01 10:15:03
> I'd like to announce the beginning of the review of the Heap library,
I have a couple of issues that I'd like to see addressed, but I'd like
to discuss them rather than just noting them in the review app.
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.
I would recommend encapsulating policies in a single top-level
parameter, for example:
template<typename T, typename Policies = default_b_heap_policies<T>>
class b_heap { ... };
where default_b_heap_policies determines the set of ancillary
parameters to the instantiation of the data structure. It could be a
template alias to a more concrete specification.
There are two main reasons I suggest this.
First, it simplifies the interface for general usage. There are only
two parameters, their order is well specified, you can describe each
parameter with concepts (probably), and general usage can probably
ignore the second parameter.
Second, it protects the template interface from later design
decisions. For example, if you accept Thorstens recommendation to
parameterize over the container type, you don't have to add a new
top-level template parameter; you would only have to modify the
default policies and the metafunctions that query for it.
Andrew
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk