@nogc vs IAllocator

Lodovico Giaretta via Digitalmars-d digitalmars-d at puremagic.com
Sat Jul 16 11:32:31 PDT 2016


And of course I forgot to link the relevant documentation...
[1] 
https://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html

> I have no idea why anyone would prefer IAllocator approach to 
> efficient and inline-able template based version. I doubt 
> template bloat from dozens of different allocators in one 
> project is realistic concern for std.xml

I was not thinking about template bloat. I was more concerned 
about how to mix it with the possibility of multiple 
implementations provided by different libraries. Conceptually one 
should use a method getDOMImplementation("list of features") and 
get a list of all implementations supporting those features that 
are linked in the binary. How should this become? 
getDOMImplementation!AllocType("list of features", allocator)? 
And in this case, how shall this method retrieve all available 
implementations from imported modules? Without templates this 
would be as easy as a module initializer that registers the 
implementation in a global list. With templates everything must 
be resolved at compile-time, and I fear that this may require 
some big hack.


More information about the Digitalmars-d mailing list