Re: How do you peek a variant containing a complex value?

2020-02-23 Thread Vinay Sajip via Digitalmars-d-learn
On Saturday, 22 February 2020 at 18:32:06 UTC, nullptr wrote: The type in v isn't Complex, it's Complex!double. Ah, great. Thanks! Missed that.

Re: How do you peek a variant containing a complex value?

2020-02-22 Thread nullptr via Digitalmars-d-learn
On Saturday, 22 February 2020 at 18:00:16 UTC, Vinay Sajip wrote: The following program won't compile if I uncomment the if statement: void main() { Variant v = complex(1.0, 1.0); //if (v.peek!(Complex)) { //writeln("Complex"); //} writeln(v); } I get the same error