On Fri, 24 Apr 2009 11:57:45 -0400, Andrei Alexandrescu
<[email protected]> 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