digitalmars.D - Request: is(typeof(X.init) == X) for all X
- Oskar Linde (18/18) May 05 2006 Hi,
- Bruno Medeiros (6/32) May 07 2006 That would be nice, as would be other changes to static arrays "alien
Hi, The subject says it all. This is currently not true for static arrays: template test(X) { static assert(is(typeof(X.init) == X)); } struct T{} mixin test!(int); mixin test!(int *); mixin test!(void delegate()); mixin test!(void function()); mixin test!(Object); mixin test!(T); mixin test!(T*); mixin test!(char[]); mixin test!(char[5]); Gives: init.d(2): static assert (is(char == char[5])) is false /Oskar
May 05 2006
Oskar Linde wrote:Hi, The subject says it all. This is currently not true for static arrays: template test(X) { static assert(is(typeof(X.init) == X)); } struct T{} mixin test!(int); mixin test!(int *); mixin test!(void delegate()); mixin test!(void function()); mixin test!(Object); mixin test!(T); mixin test!(T*); mixin test!(char[]); mixin test!(char[5]); Gives: init.d(2): static assert (is(char == char[5])) is false /OskarThat would be nice, as would be other changes to static arrays "alien type" behaviour. -- Bruno Medeiros - CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
May 07 2006