Boost logo

Boost :

From: Gary Powell (Gary.Powell_at_[hidden])
Date: 2000-08-30 14:07:00


> Jens Maurer writes:
> > - For the adjacency_list, the selectors are the wrong design, because
> > they limit the choice of base containers to a fixed set. Use
> > template template parameters instead, that's what they're there for.
> > Plus, that's the first real use of template template parameters I
> > can see :-)
>
> Actually, selectors do not limit the choice of containers to a fixed
> set. Selectors are equivalent to template template parameters, and are
> more compiler friendly :) In section 8.1.7 I describe how the
> container_gen class works. This class basically allows the user to
> define their own selectors and the mapping to the container of their
> choice.
>
The problem is you can't add new versions of container_gen<> to the
namespace "std", if you can shoe horn in the container into the ggcl format
it works, otherwise its prohibited.

namespace std {
template<class Selector, // no problem,
         class value_type, // no problem here,
         class allocator> // opps! new option,
struct container_gen<> {};

};

The more I look at this, the more I think you should just take the container
as the template class argument instead of this extra key_struct type.

  -Gary-

gary.powell_at_[hidden]


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