May 05, 2006
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 07, 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
> 
> /Oskar
> 

That 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