Did you mean to get rid of built-in arrays / kill int[] and replace it with Array!T?25-Oct-2013 16:52, Jacob Carlborg пишет:On 2013-10-25 02:01, Andrei Alexandrescu wrote:Oddly enough this can be actually done. with (setAllocator!Mallocator) { ... }setAllcator returns an rvalue that changes the global allocator to the Mallocator in the constructor, and restores it to whatever it was in thedestructor.Wouldn't this be very unsafe? Say you call another function inside the with-statement and that function assumes the standard GC for allocatingmemory.Very true. To put it simply it's a disastrous idea that sadly is too easy to be ignored.IMHO we'd better start with containers and refitting Phobos from built-in AA/arrays to user-defined containers. One interesting way there is to accept/adopt containers as OutputRange.
On Friday, 25 October 2013 at 17:57:23 UTC, Dmitry Olshansky
wrote:
- Re: std.allocator ready for some abus... Andrei Alexandrescu
- Re: std.allocator ready for some abus... Namespace
- Re: std.allocator ready for some abus... Joseph Rushton Wakeling
- Re: std.allocator ready for some abus... Namespace
- Re: std.allocator ready for some abus... Joseph Rushton Wakeling
- Re: std.allocator ready for some abus... Namespace
- Re: std.allocator ready for some abus... Maxim Fomin
- Re: std.allocator ready for some abuse Vladimir Panteleev
- Re: std.allocator ready for some abuse Jacob Carlborg
- Re: std.allocator ready for some abuse Dmitry Olshansky
- Re: std.allocator ready for some abuse Namespace
- Re: std.allocator ready for some abus... Dmitry Olshansky
- Re: std.allocator ready for some abus... Namespace
- Re: std.allocator ready for some abus... Dmitry Olshansky
- Re: std.allocator ready for some abus... Joseph Rushton Wakeling
- Re: std.allocator ready for some abus... Dmitry Olshansky
- Re: std.allocator ready for some abus... Tourist
- Re: std.allocator ready for some abus... Brad Anderson
- Re: std.allocator ready for some abus... Namespace
- Re: std.allocator ready for some abuse deadalnix
- Re: std.allocator ready for some abus... Dmitry Olshansky
