std.collection lets rename it into std,ridiculous.

a a at a.com
Mon Feb 20 00:33:51 PST 2012


> here's a
> stack:
>
> 	T[] stack;
> 	void push(elem) {
> 		stack ~= elem;
> 	}
> 	T pop() {
> 		T elem = stack[$-1];
> 		stack = stack[0..$-1];
> 		return elem;
> 	}

Won't this reallocate every time you pop an element and then push 
a new one?




More information about the Digitalmars-d mailing list