TypeInfo in the library

Benjamin Thaut code at benjamin-thaut.de
Sun Feb 16 02:47:55 PST 2014


Am 14.02.2014 16:32, schrieb Adam D. Ruppe:
> On Friday, 14 February 2014 at 09:09:42 UTC, Benjamin Thaut wrote:
>> But that would mean that you have to pull the implementation of casts
>> and other features that rely on TypeInfo right now into the library too.
>
> They already are: druntime/src/rt/cast_.d I wouldn't change that, I'm
> more thinking about changing rt/typeinfo/*.d from being hand-written to
> auto generated by a template and moving the object size and layout from
> the compiler (see verifyStructSize in dmd) to the druntime code too.
>
> No phobos here, that would definitely be a bad idea.
>
>> making at lot harder to use D without phobos unless you want to
>> rewrite the entire TypeInfo and all features depending on it.
>
> Right now, if you try to use D without druntime, it will complain about
> missing typeinfos and force you to create the classes with a particular
> size. Much of it can be auto generated by templates now (which gives a
> lot of cool flexibility btw), but you are still locked into the
> compiler's fairly strict layout. I want to open up some flexibility.

Ok, I misunderstood you then. Moving TypeInfo generation to druntime 
would actually be a good idea. Ocasionally I wanted to extend TypeInfo 
for various use cases.

I said using D without phobos, I never said using D without druntime. 
Thats a difference.


More information about the Digitalmars-d mailing list