June 05, 2023 [Issue 23967] 12.14 Array Properties - capacity description | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23967 --- Comment #1 from Franciszek Czekala <home@valentimex.com> --- However, when you shrink the array a like this: a=a[0..$-1], the subsequent capacity will show as zero, so there is inconsistency here which looks like a bug to me. Example: int[] a = new int[10]; // a.length == 10, a.capacity == 11 a = a[0..$-1]; // a.length == 9, a.capacity == 0 (???) Either capacity represents the total number of elements that an array can hold or it represents the amount of elements that can be appended. As can be seen above it can be either the former or the latter depending on the context which seems definitely wrong. -- |
December 15 [Issue 23967] 12.14 Array Properties - capacity description | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23967 --- Comment #2 from dlangBugzillaToGithub <robert.schadek@posteo.de> --- THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dlang.org/issues/4131 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB -- |
Copyright © 1999-2021 by the D Language Foundation