On 18 March 2013 09:35, Nevin Liber
On 18 March 2013 07:29, Thorsten Ottosen
wrote: Its no different than using boost::function<>, that is, it allow us to make a generic interface with decisions deferred till run-time (at the expense of a performance loss).
It isn't just *one* generic interface; the underlying iterators have to be type erased as well.
To be completely generic, you may need to type erase allocator_type, pointer, const_pointer, reference, const_reference, size_type and difference_type (since they may all differ between containers, and many of those types now come from the underlying allocator), as well as have the ability to pass an allocator in for both holding the type erased container as well as any of the underlying type erased objects. -- Nevin ":-)" Liber mailto:nevin@eviloverlord.com (847) 691-1404