DMD 0.177 release

Lutger lutger.blijdestijn at gmail.com
Sat Dec 9 06:17:38 PST 2006


JohnC wrote:
  > opAssign is new as well, but it throws an AV - unless I'm not using it
> right?
> 
> class Test {
> 
>   int value;
> 
>   void opAssign(int value) {
>     this.value = value;
>   }
> 
> }
> 
> void main() {
>   Test t = 10;
> } 
> 

This works:

void main() {
    Test t = new Test;
    t = 10;
}

I'm surprised this overload is in, as I thought it was considered 
dangerous. Not that I'm complaining btw!





More information about the Digitalmars-d-announce mailing list