<div dir="ltr">On Mon, Jan 7, 2013 at 7:25 PM, David Nadlinger <span dir="ltr"><<a href="mailto:see@klickverbot.at" target="_blank">see@klickverbot.at</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Monday, 7 January 2013 at 15:01:27 UTC, Gor Gyolchanyan wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How can I have an associative array, which uses a custom allocator?<br>
</blockquote>
<br></div>
I'm afraid the only viable solution right now is to implement your own AA type as a struct with overloaded operators (which is in fact what the built-in AAs are lowered to as well).<br>
<br>
There are two downside to this, though - besides, of course, the fact that you need a custom implementation:<br>
 - You cannot pass your type to library functions expecting a built-in associative array.<br>
 - You lose the convenient literal syntax. This could be fixed in the language, though, by providing a rewrite to a variadic constructor of user types for array/AA literals, thus eliminating the need for GC allocations (gah, another thing I just need to find the time to write up a DIP for…).<span class="HOEnZb"><font color="#888888"><br>

<br>
David<br>
</font></span></blockquote></div><br>This means, that <a href="http://dlang.org">dlang.org</a> is lying. D doesn't provide both a garbage collector and manual memory management. It provides a garbage collector and a lousy excuse for manual memory management. As much as I love D for it's metaprogramming and generative programming, it's not even remotely fit for system-level programming the way it claims it is.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I don't mean to be trolling, but it's not the first time I got grossly disappointed in D.<br clear="all"><div><br></div>-- <br>Bye,<br>Gor Gyolchanyan.
</div></div>