-nogc

Steven Schveighoffer schveiguy at yahoo.com
Fri Apr 24 11:14:45 PDT 2009


On Fri, 24 Apr 2009 11:57:45 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> 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.

Yes, but each T[] does not have it's own sort routine.  With a template,  
that would not be the case (I think).  Not that I think the current way is  
the best, just pointing out a difference.

-Steve



More information about the Digitalmars-d mailing list