Are iterators and ranges going to co-exist?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Jul 21 12:25:33 PDT 2010


On 07/21/2010 01:18 PM, Joaquin M Lopez Munoz wrote:
> == Quote from Andrei Alexandrescu (SeeWebsiteForEmail at erdani.org)'s article
>> Joaquin M Lopez Munoz wrote:
>>> I'd like to state that Boost.MultiIndex internal implementation is *not*
>>> based on iterators, so the whole discussion iterators vs. ranges does
>>> not impact Boost.MultiIndex memory usage in any manner.
>>>
>>> Joaquín M López Muñoz
>>> Telefónica, Investigación y Desarrollo
>>
>> Welcome, Joaquín! Good to see you here. Could you please provide a bit
>> more detail? Does Boost.MultiIndex use pointers? Thanks!
>
> The implementation is based on nodes interlinked with pointers,
> just as say your favorite std::set implementation.
[snip]

That's very illuminating, thanks for the explanation. So there are nodes 
in fixed positions and they are wired in various ways as dictated by the 
respective orderings. Very cool.

> PS: I'd be delighted if some bold sould took the challenge of
> porting Boost.MultiIndex to D. My collected reports show
> that the lib is quite popular in C++, so having it in D could
> be welcome. I can't program in D, but if someone decides to
> go down this path I'd love to assist with discussions on
> the design and internals.

That sounds great. I, too, think that multi_index is a very useful 
structure. It should be quite easy to generalize the up-and-coming 
RBTree implementation (Steve... :o)) into accepting multiple ordering 
predicates. Since the number of predicates is available during 
compilation, the Node structure should be easy to implement by using a 
fixed-size array for the header.


Andrei


More information about the Digitalmars-d mailing list