www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Getting Data Members of an Aggregate

reply =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
How do I extract only the *data* members of an aggregate type `T`.

Simpliy `__traits(allMembers, T)` is not enough since it all 
returns function, type and alias members along side the data 
members.

I need this when serializing an instance of the element type to 
be inserted into a radix tree container.
Sep 18 2016
parent Jonathan M Davis via Digitalmars-d-learn writes:
On Sunday, September 18, 2016 21:49:58 Nordl÷w via Digitalmars-d-learn wrote:
 How do I extract only the *data* members of an aggregate type `T`.

 Simpliy `__traits(allMembers, T)` is not enough since it all
 returns function, type and alias members along side the data
 members.

 I need this when serializing an instance of the element type to
 be inserted into a radix tree container.
T.tupleof https://dlang.org/spec/struct.html#struct_properties - Jonathan M Davis
Sep 18 2016