Difference between slice[] and slice
WhatMeWorry
kheaser at gmail.com
Wed Sep 25 19:06:12 UTC 2019
Just got through debugging a line of code which uses dynamic
array. It boiled to to my use of []. How should I "D think"
about slice[]? The run time error seems to say the the length of
[] is zero. I was assuming that [] meant "the entirety" of the
array.
In short, is there anytime that one would want to use "slice[] =
something" syntax?I
//waste[] = waste[0..$-1]; // object.Error@(0): Array lengths
don't match for copy: 0 != 1
waste = waste[0..$-1]; // works
More information about the Digitalmars-d-learn
mailing list