tupleof.length of a class in a template return 0

"Michaël "Michaël
Mon Apr 16 17:04:15 PDT 2012


On Monday, 16 April 2012 at 23:58:29 UTC, Michaël Larouche wrote:
> I've given a second chance to D after watching D videos from 
> Lang.NEXT 2012. As a first look, I wanted to try generate 
> serialization code at compile time.
>
> Here's the class:
> class MyObject
> {
>     public int m_id;
>     public Data m_data;
>     public bool AutoDelete;
>     public int RefCount;
>
> mixin(AddStreamSerialization!(MyObject));
> }

Sorry I hit the send button.

My template works with a struct but when I try to mixin my 
template in a class, I get compile error because T.tupleof.length 
returns 0.

Here's the whole code:
http://ideone.com/UR6YU


More information about the Digitalmars-d-learn mailing list