delete hash[key] deprecated???

Max Samukha samukha at voliacable.com.removethis
Tue Jul 15 07:54:25 PDT 2008


On Tue, 15 Jul 2008 11:13:33 -0300, Leandro Lucarella
<llucax at gmail.com> wrote:

>Stewart Gordon, el 15 de julio a las 01:14 me escribiste:
>> "Jarrett Billingsley" <kb3ctd2 at yahoo.com> wrote in message 
>> news:fopjrt$1b2c$1 at digitalmars.com...
>> <snip>
>> >>If not, do I have to do:
>> >>auto c = hash["x"];
>> >>hash.remove["x"];
>> >>delete c;
>> >
>> >Yeah, you do.
>> 
>> 
>> No I don't.
>> 
>>    delete * cast(Object*) &hash["x"];
>
>Phew! That's much better! (!) o_O

An alternative hack:

delete *("x" in hash);


More information about the Digitalmars-d-learn mailing list