Re: Intelligent Scope Hierarchy

2013-11-01 Thread Stretto
On Friday, 1 November 2013 at 08:59:36 UTC, Namespace wrote: On Friday, 1 November 2013 at 05:49:04 UTC, Stretto wrote: On Thursday, 31 October 2013 at 22:03:18 UTC, Namespace wrote: The 'it' property is only some 'singleton' approach. You can write: void foo() { auto buffer = Mallocator.all

Re: Intelligent Scope Hierarchy

2013-11-01 Thread Namespace
On Friday, 1 November 2013 at 05:49:04 UTC, Stretto wrote: On Thursday, 31 October 2013 at 22:03:18 UTC, Namespace wrote: The 'it' property is only some 'singleton' approach. You can write: void foo() { auto buffer = Mallocator.allocate(42); /// ... many code } And at the end of the scop

Re: Intelligent Scope Hierarchy

2013-10-31 Thread Stretto
On Thursday, 31 October 2013 at 22:03:18 UTC, Namespace wrote: The 'it' property is only some 'singleton' approach. You can write: void foo() { auto buffer = Mallocator.allocate(42); /// ... many code } And at the end of the scope buffer is cleared because Mallocator's destructor call

Re: Intelligent Scope Hierarchy

2013-10-31 Thread Namespace
The 'it' property is only some 'singleton' approach. You can write: void foo() { auto buffer = Mallocator.allocate(42); /// ... many code } And at the end of the scope buffer is cleared because Mallocator's destructor call deallocateAll (if I'm not wrong).

Intelligent Scope Hierarchy

2013-10-31 Thread Stretto
Hi, I'm new to D and stumbled on the new allocators thread. In the help there is code like auto buffer = Mallocator.it.allocate(1024 * 1024 * 4); scope(exit) Mallocator.it.deallocate(buffer); which seems redundant and error prone. Would it not be possible for allocate to automatically