depreciated function delete

Ali mammadov.ali at ideal.az
Fri Jan 18 21:32:11 UTC 2019


On Friday, 18 January 2019 at 21:13:34 UTC, Steven Schveighoffer 
wrote:
> On 1/18/19 3:48 PM, alik wrote:
>> Hi there. as you know delete function is depreciated. so I 
>> tried to use the __delete function for the code below:
>> 
>> if (this.parse_buffer.length > this.parse_size)
>>              {
>>                  __delete(this.parse_buffer);
>>                  this.parse_buffer.length = this.parse_size;
>>              }
>> 
>> 
>> but in return after I compile code I get the error like : 
>> Undefined identifier.
>> when I use destroy instead I don't get any errors. but I want 
>> to use __delete because of the garbage collector as it frees 
>> up the memory
>> 
>> thanks in advance.
>
> import core.memory: __delete;
>
> -Steve

thank you for your quick answer. I did it for my own files but 
should I change something in here :

/root/.dub/packages/undead-1.0.9/undead/src/undead/regexp.d(370,17): Deprecation: The delete keyword has been deprecated.  Use object.destroy() (and core.memory.GC.free() if applicable) instead.



More information about the Digitalmars-d-learn mailing list