DMD 0.161 release

Walter Bright newshound at digitalmars.com
Tue Jun 20 11:45:23 PDT 2006


BCS wrote:
> Walter Bright wrote:
>> Stewart Gordon wrote:
>>>
>>> "Fixed Bugzilla 85  (now issues error message)"
>>>
>>
>> 85: It can't be made to work, because an interface handle is different 
>> from a class handle. It doesn't work in C++, either, for the same 
>> reasons.
> 
> Anyway to get a cast? (If it is already there...)
> Somthing like:
> 
> interface I{...}
> class C : I {...}
> ...
> 
> C[] c;
> I[] i;
> 
> c = ....;
> 
> i = cast(I)c;
> 
> // same as
> 
> i.length = c.length;
> foreach(int j, C e; c)
>     i[j] = (null !is e)?e:null;
> 

You'll have to iterate over the loop and cast each element.



More information about the Digitalmars-d-announce mailing list