Re: Unexpected result of IsInstanceOf

2020-01-30 Thread Ali Çehreli via Digitalmars-d-learn
On 1/30/20 4:51 PM, Ben Jones wrote: The following result doesn't make sense to me... how does isInstanceOf return false? ``` import std.traits; import std.stdio; import std.typecons; auto f(T)(T t){ return Nullable!T(t); } void main(){     auto f3 = f(3);    

Re: Unexpected result of IsInstanceOf

2020-01-30 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 31 January 2020 at 00:51:45 UTC, Ben Jones wrote: writeln(typeof(f3).stringof); writeln(isInstanceOf!(Nullable, f3)); In the first one, you check typeof, but not in the second one. writeln(isInstanceOf!(Nullable, typeof(f3))); // true The template argument there was T

Unexpected result of IsInstanceOf

2020-01-30 Thread Ben Jones via Digitalmars-d-learn
The following result doesn't make sense to me... how does isInstanceOf return false? ``` import std.traits; import std.stdio; import std.typecons; auto f(T)(T t){ return Nullable!T(t); } void main(){ auto f3 = f(3); writeln(typeof(f3).stringof);