14 Mar
2013
14 Mar
'13
9:48 p.m.
On 14 March 2013 16:31, Neil Groves
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@eviloverlord.com (847) 691-1404