Serialization for D. Comments, please!

BCS ao at pathlink.com
Thu Jun 18 16:04:49 PDT 2009


Reply to grauzone,

>> Can you get the mangled name of an object instance at runtime via
>> typeinfo?
>> 
> Not that I know of. IMHO, ClassInfo.name() is good enough.
> 
> But if you don't like it, just keep using mangleof. You obviously have
> compile time access to the serializeable type, e.g.:
> 
> char[][ClassInfo] TypeMangledNames;
> 
> template SerializeMixin() {
> static this() { TypeMangledNames[typeof(this).classinfo] = typeof(this).mangleof; 
}
> }
> 

I'm looking at what it would take to get by without a mixin in the types 
(someone objected to that) without loosing anything I want. with a mixin 
in the class, I've already got a solution.




More information about the Digitalmars-d-announce mailing list