Boost logo

Boost :

Subject: Re: [boost] Abstract STL Container Adaptors
From: Nevin Liber (nevin_at_[hidden])
Date: 2013-03-14 16:55:07


On 14 March 2013 12:20, Andy Jost <Andrew.Jost_at_[hidden]> wrote:

>
> In some cases, particularly when compile times are more critical than
> execution times, it would be preferable to let the caller choose the set
> implementation without losing the advantages of separate compilation.

Do you have any benchmarks to show this isn't in the noise?

> It seems the implementation of this would be a straightforward application
> of type erasure. It seems too easy, in fact, which makes me wonder whether
> I'm missing something.
>

*Every* operation becomes slow. Algorithms become really slow, if callable
at all. For instance, if you had a "wrapper" that models a sequence
container, what iterator category do you pick for it? If you pick, say,
bidirectional iterator (the minimum needed for vector, deque and list), all
of a sudden you can't use a bunch of algorithms (most of the sorting
algorithms, shuffle, etc.).

> In any case, is this a good idea?
>

I can't think of a case I've ever had for choosing the container at run
time.

-- 
 Nevin ":-)" Liber  <mailto:nevin_at_[hidden]>  (847) 691-1404

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