<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.1.92">
</HEAD>
<BODY>
I don't think it's a good idea. In this case it's my fault, I should imagine that a size_t datatype exists for arrays.<BR>
BTW on generic cases with aliases it would be useful to have an error like :<BR>
<BR>
"Error: cannot implicity convert expression (leaves.length) of type size_t (ulong) to uint."<BR>
<BR>
If not, i'll fix it using ulong and then when i'll go back on 32bit (or on a case where alias is defined in another way) compiling will fail again.<BR>
<BR>
Il giorno ven, 11/11/2011 alle 09.58 +0100, Alex Rønne Petersen ha scritto:
<BLOCKQUOTE TYPE=CITE>
<PRE>
On 11-11-2011 09:30, Andrea Fontana wrote:
> That's exactly what I was looking for. So it works as in most
> programming languages :P
> Dmd has deceived me. It says:
>
> "Error: cannot implicitly convert expression (leaves.length) of type
> ulong to uint"
>
> It should say:
> "Error: cannot implicitly convert expression (leaves.length) of type
> size_t to uint"
>
> Il giorno gio, 10/11/2011 alle 15.19 +0000, Dejan Lekic ha scritto:
>> Andrea Fontana wrote:
>>
>> >  Some functions (for example array length) return ulong on dmd64 e uint
>> >  on dmd32
>> >  I need to compile on both platform: which is the right/best/clean way?
>>
>> Andrea, use the size_t type.

DMD generally uses the actual type rather than the alias' name when 
you're using an aliased type.

- Alex
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>