[Issue 4523] .remove method for Associative Arrays returns void in all cases

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 27 18:16:28 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4523



--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2010-07-27 18:16:27 PDT ---
(In reply to comment #0)
> Example code errors out due to the .remove method returning void. This method
> should return boolean true if the key was in the associative array, or false
> otherwise:
> 
> void main() {
>    int[string] array = ["test":0, "test2":1];
> 
>    bool found = array.remove("test");
>    bool notfound = array.remove("nothing");
> }
> 
> Errors:
> assoc_test.d(6): Error: expression array TOK44 "test" is void and has no value
> assoc_test.d(7): Error: expression array TOK44 "nothing" is void and has no
> value

I forgot to add that TDPL states this on page 116.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list