opAssign and references

Timon Gehr timon.gehr at gmx.ch
Tue Jan 31 14:12:34 PST 2012


On 01/31/2012 06:15 PM, Nicolas Silva wrote:
> Hi,
>
>> Works for me. Which version of the compiler are you using?
>
> Sorry, i forgot to mention: i'm using dmd 2.057 on ubuntu 32bit.
>

I am using DMD 2.057 on Ubuntu 64bit. Are you sure that it does not 
work? Can anyone reproduce the error?

import std.variant;
struct Foo {
     Variant a;
     ref Variant refA(){
         return a;
     }
}
void main(){
     Foo f1;
     f1.refA() = 24;
}



More information about the Digitalmars-d-learn mailing list