Michael Fawcett
On Jan 30, 2008 12:48 PM, Joaquín Mª López Muñoz
wrote: Not all STL containers provide an allocator ctor (associative containers don't),
Ah, sorry for the blanket statement (I had been using vector and list as my test structures thus far). Do you know the rational or historical reasons for not including those ctors in the associative containers?
Umm... Well, there's a theoretic possibility that we hit ambiguity: set(const Compare&=Compare(),const Allocator&=Allocator()); set(const Allocator&); What happens if Compare is the same type as Allocator? The possibility of this happening in the real world is close to zero, but theoretically it is possible: template<typename T> struct less_and_allocator: public std::allocator<T>, public std::less<T> { }; typedef std::set< int, less_and_allocator<int>, less_and_allocator<int>
paradoxical_set;
I'm holding your proposal in my todo list, but I have to think it over a bit. Thank you, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo