delete hash[key] deprecated???

Leandro Lucarella llucax at gmail.com
Mon Feb 11 06:13:03 PST 2008


Jarrett Billingsley, el 11 de febrero a las 08:50 me escribiste:
> "Leandro Lucarella" <llucax at gmail.com> wrote in message 
> news:20080211130722.GA18729 at burns.springfield.home...
> 
> > And I got: Error: delete aa[key] deprecated, use aa.remove(key)
> 
> As the error suggests, the first syntax was used before the second was 
> introduced.  The funny thing is, the 'remove' syntax was partially 
> introduced to allow exactly what you're trying to do.  X(
> 
> > I don't want to remove the element of the array, I want to destroy the
> > object stored at key "x". Does hash.remove("x") remove the item from the
> > hash *and* delete c?
> 
> No.
> 
> > If not, do I have to do:
> > auto c = hash["x"];
> > hash.remove["x"];
> > delete c;
> 
> Yeah, you do. 

Ugly :(

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
You are the very reason why everything happens to you


More information about the Digitalmars-d-learn mailing list