Deque impl.

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Jan 31 09:48:26 PST 2013


On 1/31/13 12:16 PM, Dmitry Olshansky wrote:
> Then the only layout left to propose is an array of blocks. Then
> indexing is done like:
> blocks[idx>>N][idx&mask]
> if block size is power of 2. Not half-bad and still O(1).

Yah that's how C++'s deque is implemented. Blocks are of 
statically-fixed size.

Andrei




More information about the Digitalmars-d mailing list