Assosiative array pop

Rene Zwanenburg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 26 02:35:37 PDT 2014


On Wednesday, 25 June 2014 at 14:17:50 UTC, Meta wrote:
> Then to "pop" the first element, just do 'arr = arr[1..$]'.

Or import std.array to get the range primitives for slices:

import std.array;

void main()
{
   auto arr = [1, 2, 3, 4];
   arr.popFront();
   assert(arr.front == 2);
}


More information about the Digitalmars-d-learn mailing list