Re: Compiler doesn't complain with multiple definitions

2015-11-12 Thread anonymous via Digitalmars-d-learn
On 12.11.2015 06:27, ric maicle wrote: 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

Re: Compiler doesn't complain with multiple definitions

2015-11-12 Thread ric maicle via Digitalmars-d-learn
On Thursday, 12 November, 2015 07:50 PM, anonymous wrote: __traits has special syntax. The first "argument" must be from a list of special keywords that only have special meaning in that place. You can't put the name of a struct there, and you can't put the special keyword anywhere else. So

Re: Compiler doesn't complain with multiple definitions

2015-11-12 Thread John Colvin via Digitalmars-d-learn
On Thursday, 12 November 2015 at 15:06:26 UTC, ric maicle wrote: On Thursday, 12 November, 2015 07:50 PM, anonymous wrote: __traits has special syntax. The first "argument" must be from a list of special keywords that only have special meaning in that place. You can't put the name of a struct

Compiler doesn't complain with multiple definitions

2015-11-11 Thread ric maicle via Digitalmars-d-learn
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