On Thursday, 25 January 2018 at 19:49:05 UTC, JN wrote:
if (!hasUDA!(member, "noserialize"))
Nevermind, I get it now, member is only the field name, not a
'reference', changed it to:
if (!hasUDA!(mixin(T.stringof ~ "." ~ member), "noserialize"))
and works now
On 01/25/2018 11:49 AM, JN wrote:
foreach (i, member; FieldNameTuple!T)
{
if (!hasUDA!(member, "noserialize"))
{
writeln(member);
}
'member' is a string local variable, which does not have that UDA. You
need to get the
I decided it's time to learn how std traits work. I still find
the whole compile time business a bit weird to deal with, so I
decided to write a simple JSON serializer for struct that loops
over member fields and outputs them.
import std.stdio;
import std.json;
import std.traits;
struct TestS