Boost logo

Boost :

Subject: Re: [boost] [Containers] Should flat_* expose implementation vector?
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2011-08-05 21:19:58


On Fri, Aug 5, 2011 at 5:32 PM, Phil Endecott <
spam_from_boost_dev_at_[hidden]> wrote:

> Dear All,
>
> Should Ion's proposed flat_set, flat_map etc. expose the underlying vector
> that they use as their implementation?
>
> Pros: it lets the user efficiently load and save the content, and implement
> algorithms that cannot be done via the flat_* interface.
>
> Cons: it lets the user break the invariants.
>
> Const access to the impl is another possibility.
>
> Related to that: could the implementation type be a template parameter?
> Example: could one implement a flat_set on top of a stable_vector? (Is
> that useful?) And/or: should flat_* actually be adaptors that take a
> reference to their underlying implementation?
>

Maybe consider the flat_* interface factored out into a family of free
functions applicable to any...ummm..."extensible" (e.g., has some kind of
push_back functionality, etc.?) range?

Just a quick thought.

- Jeff


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