On Thursday, March 14, 2013, Andy Jost wrote:
On 14 March 2013 16:31, Neil Groves
javascript:;> wrote: 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?
The key question is: who gets to make that decision? ``my_algorithm`` may be happy to use std::set, but it's really the caller's choice. Perhaps the information ``my_algorithm`` needs already lives somewhere in a boost::multi_index_container. Does it really need to be copied just to call ``my_algorithm``?
I really cannot follow this. If the container is type erased, how do you get that information you are alluding to back out?
Perhaps I would like to compile ``my_algorithm`` once and stick it in a library file. Does it really need to be recompiled for each concrete container type?
There are plenty of papers and implementations of any_iterator out there. Why is that not sufficient for your needs? -- Nevin ":-)" Liber mailto:nevin@eviloverlord.com (847) 691-1404