Program size, linking matter, and static this()

Jacob Carlborg doob at me.com
Fri Dec 16 12:49:34 PST 2011


On 2011-12-16 20:23, Steven Schveighoffer wrote:
>
> I disagree with this assessment. It's good to know the cause of the
> problem, but let's look at the root issue -- reflection. The only reason
> to include class information for classes not being referenced is to be
> able to construct/use classes at runtime instead of at compile time. But
> if you look at D's runtime reflection capabilities, they are quite poor.
> You can only construct a class at runtime if it has a zero-arg constructor.

It's not very useful as is, but you can create your own version that 
doesn't call the constructor and that can be more useful sometimes. I'm 
using that technique in my serialization library and providing a special 
method that can act as a constructor.


-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list