[Issue 16269] add `aa.ensureAllocated` method to associative array to clear and initialize it

2019-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16269 Nick Treleaven changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 16269] add `aa.ensureAllocated` method to associative array to clear and initialize it

2019-02-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16269 Nick Treleaven changed: What|Removed |Added See Also||https://issues.dlang.org/sh

[Issue 16269] add `aa.ensureAllocated` method to associative array to clear and initialize it

2016-07-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16269 Jon Degenhardt changed: What|Removed |Added CC||jrdemail2000-dl...@yahoo.co

[Issue 16269] add `aa.ensureAllocated` method to associative array to clear and initialize it

2016-07-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16269 --- Comment #9 from Ketmar Dark --- so here is the fixed patch, and new tests: === diff --git a/src/object.d b/src/object.d index 40e2391..5ac132c 100644 --- a/src/object.d +++ b/src/object.d @@ -1876,6 +1876,7 @

[Issue 16269] add `aa.ensureAllocated` method to associative array to clear and initialize it

2016-07-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16269 Steven Schveighoffer changed: What|Removed |Added Assignee|nob...@puremagic.com|schvei...@yahoo.com --

[Issue 16269] add `aa.ensureAllocated` method to associative array to clear and initialize it

2016-07-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16269 --- Comment #8 from Ketmar Dark --- >I get a chance, I'll make a PR thank you. >I will check for null pointer in wrapper rather than the runtime code to avoid >extra >opaque calls. yes, this is way better, tnx again. i planned to do exactly that, b

[Issue 16269] add `aa.ensureAllocated` method to associative array to clear and initialize it

2016-07-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16269 --- Comment #7 from Steven Schveighoffer --- Just adding a note for myself when I make the PR, the AA is and always will be an implementation pointer as the only member. I will check for null pointer in wrapper rather than the runtime code to avoid e

[Issue 16269] add `aa.ensureAllocated` method to associative array to clear and initialize it

2016-07-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16269 --- Comment #6 from Steven Schveighoffer --- Thanks, this looks really good. I like the returning of itself, so you just put ensureAllocated on the call and it just works in all cases where you normally have an AA. When I get a chance, I'll make a P

[Issue 16269] add `aa.ensureAllocated` method to associative array to clear and initialize it

2016-07-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16269 --- Comment #5 from Ketmar Dark --- oops. forgot to fix the comment. sorry. ;-) --

[Issue 16269] add `aa.ensureAllocated` method to associative array to clear and initialize it

2016-07-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16269 --- Comment #4 from Ketmar Dark --- another try. this time it adds `ensureAllocated()` method, which can be used like this: == void test (string[int] aa) { aa[42] = "42"; } void main () { // inline { str

[Issue 16269] add `aa.ensureAllocated` method to associative array to clear and initialize it

2016-07-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16269 Ketmar Dark changed: What|Removed |Added Summary|add `aa.clear!true` method |add `aa.ensureAllocated` |to