[Issue 16269] add `aa.ensureAllocated` method to associative array to clear and initialize it
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Jul 31 12:42:14 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16269
Jon Degenhardt <jrdemail2000-dlang at yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jrdemail2000-dlang at yahoo.co
| |m
--- Comment #10 from Jon Degenhardt <jrdemail2000-dlang at yahoo.com> ---
(Apologies for such a late comment, hope it's not disruptive.)
Would it make sense to consider including a 'reserve' capability with this
change? See https://issues.dlang.org/show_bug.cgi?id=2504.
Ensuring allocation could be seen as having a relationship with reserving an
amount of space. At the API level, it could possibly be done by adding an
optional argument to ensureAllocated that would reserve space. The con to this
approach might simply be that 'reserve' or setting the 'length' property would
be more consistent with other APIs already being used in D.
--
More information about the Digitalmars-d-bugs
mailing list