Boost logo

Boost :

From: jsiek_at_[hidden]
Date: 2000-08-30 15:22:09


Gary Powell writes:
> 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<> {};
>
> };

Actually, there's a way to get around this by templating
the selector:

template <class Allocator>
struct garys_containerS { };

template <class Allocator, class T>
struct container_gen< garys_containerS<Allocator>, T>
{
  typedef garys_container<T, Allocator> type;
};

> 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.

The problem with this is that the value_type that will go into the container is
really an implementation detail that the user shouldn't have to know
about.

Cheers,

Jeremy


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