Boost logo

Boost :

Subject: Re: [boost] Abstract STL Container Adaptors
From: Nevin Liber (nevin_at_[hidden])
Date: 2013-03-14 17:48:18


On 14 March 2013 16:31, Neil Groves <neil_at_[hidden]> wrote:

>
> Virtual functions calls add very appreciable overhead relative to the
> numerous small functions that would need runtime polymorphism for the idiom
> to work. The overhead is particularly severe with super-scalar processor
> architectures. To some this won't be important of course.
>

Of course, if performance it isn't important, then just use std::set and be
done with it.

Is there any criterion besides performance that people choose between set
and unordered_set where generalization would make any sense?

Maybe < vs. hashing/==, but if I were to choose it at runtime, my type
would have to implement all three.

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