Re: isPOD is broken?

2021-03-27 Thread Oleg B via Digitalmars-d-learn
On Friday, 26 March 2021 at 12:13:29 UTC, kinke wrote: A class *reference* is always a POD. Only structs can be non-PODs. In this case what means "does not have virtual functions, does not inherit"? Structs doesn't have virtual methods and they can't inherits.

Re: isPOD is broken?

2021-03-26 Thread kinke via Digitalmars-d-learn
A class *reference* is always a POD. Only structs can be non-PODs.

isPOD is broken?

2021-03-26 Thread Oleg B via Digitalmars-d-learn
Hi all! class Foo { private int val; this(int v) { val = v; } int vv() { return val*2; } ~this() { } } class Bar : Foo { this(int v) { super(v); } override int vv() { return val*3; } } pragma(msg, __traits(isPOD, Foo)); pragma(msg, __traits(isPOD, Bar)); prints true