[2.0] Remove deprecation of delete hash[key] (and change its semantics)

Leandro Lucarella llucax at gmail.com
Mon Feb 11 06:18:10 PST 2008


When doing: delete hash[key] in D 1.0, there is a deprecation error about
being an old syntax for hash.remove(key). So now, if you have an hash of
objects, and you want to do explicit memory deallocation, you have to do
something like this:

auto tmp = hash[key];
hash.remove(key);
delete tmp;

Which is ugly and nonsense. Maybe remove it from 1.0 could be
contraversial, but I think there is no point in conserving this ugly
behaviour in 2.0.

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
Vaporeso sostenía a rajacincha la teoría del No-Water, la cual le
pertenecía y versaba lo siguiente: "Para darle la otra mejilla al fuego,
éste debe ser apagado con alpargatas apenas húmedas".



More information about the Digitalmars-d mailing list