-nogc

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Apr 24 08:57:45 PDT 2009


Christian Kamm wrote:
> Andrei Alexandrescu Wrote:
>> 1. Put array definitions in object.d. Have the compiler rewrite "T[]" ->
>> ".Array!(T)" and "[ a, b, c ]" -> ".Array!(typeof(a))(a, b, c)". I think
>> superdan suggested that when he wasn't busy cursing :o).
> 
> While I'd support such a rewriting of builtin arrays and associative arrays,
> it comes at a cost: one template instantiation per contained type, which will 
> lead to more code and TypeInfo / ClassInfo initializers than the current
> implementation requires.
> 
> Can you come up with a solution that can seamlessly switch between RTTI
> based containers and templated containers?

Good question. I don't know how the typeinfo could go away, but right 
now we're in that boat already - each T[] has its own typeinfo. 
Implementation-wise, there are techniques to reduce code bloating.

Andrei



More information about the Digitalmars-d mailing list