
On Sat, Jul 25, 2009 at 7:11 AM, Andrei Alexandrescu < andrei@metalanguage.com> wrote:
David Abrahams wrote:
on Fri Jul 24 2009, Andrei Alexandrescu <andrei-AT-metalanguage.com> wrote:
Another example of an iterator-based design that's not easy to
replicate with ranges is Boost Multi-Index. (Thanks Emil Dotchevski for pointing that out during my talk. (Marshall Clow promised the video will be available Real Real Soon Now(tm).)) In Multi-Index, indexes store iterators; storing ranges would often waste twice the space for little or no benefit.
Can't you handle that by storing a range that always contains only one element: [iterator,iterator+1)?
You can, but that doubles the memory eaten by the index.
Isn't it possible to create single element ranges from every iterator by slightly modifying its interface to fulfill a range concept (without additional memory requirements)? -Kai