Compiler doesn't complain with multiple definitions

ric maicle via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Nov 11 21:27:14 PST 2015


I was playing with __traits and tried the code below.
Shouldn't the compiler emit a warning that I'm defining isPOD
multiple times and/or I'm defining something that is built-in
like isPOD?

// DMD64 D Compiler v2.069
import std.stdio;

struct isPOD {
bool status = false;
}

int main()
{
     byte isPOD = 0;
     writeln(isPOD);
     writeln(__traits(isPOD, typeof(isPOD)));
     return 0;
}


More information about the Digitalmars-d-learn mailing list