How do I compute at compile time the offset of a field into a struct?

The context is putting it into a table.


I know about structs and unions.  Unions are type-unsafe.  Is there a 
type-safe way to handle a struct that needs several variations?

The struct will have a type field to tell me which variation it is.  I will 
have a macro to build each variation.    There is only one place that looks at 
the variations.  It will do a select on the type field with a few lines of 
code for each variation.  So all in all, it's pretty clean.  I'm just looking 
for a way to do better.



-- 
These are my opinions.  I hate spam.



_______________________________________________
devel mailing list
devel@ntpsec.org
http://lists.ntpsec.org/mailman/listinfo/devel

Reply via email to