
On 14 March 2013 12:20, Andy Jost
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@eviloverlord.com (847) 691-1404