How do you deal with scoped allocations?

Namespace rswhite4 at googlemail.com
Mon Dec 9 04:32:35 PST 2013


On Monday, 9 December 2013 at 12:29:44 UTC, monarch_dodra wrote:
> On Sunday, 8 December 2013 at 18:55:26 UTC, Namespace wrote:
>> On Sunday, 8 December 2013 at 18:33:39 UTC, Joseph Rushton 
>> Wakeling wrote:
>>> On 08/12/13 19:18, thedeemon wrote:
>>>> I just use
>>>>   scope(exit) delete buf;
>>>
>>> Deprecated or at least disapproved of, no?
>>
>> Sadly yes.
>
> Unless I'm mistaken, the only thing that was deprecated was 
> scoped as an attribute to variables.
>
> The scope *statement* is till valid, and one of D's more 
> powerful arguments in "simple and exception safe programming".

'delete' was meant. ;)


More information about the Digitalmars-d mailing list