Type qualifiers - inout error

Claudiu Verdes claudiu.verdes at gmail.com
Thu Jun 16 16:01:51 PDT 2011


Hi,

I'm new to D and trying to follow Alexandrescu's TDPL code examples I came
across an error on the code below:

class A
{
inout(int) val() inout
{
return _val; // error - see below
}
private int _val;
};

The compiler (dmd v2.052) complains on the marked line with the message
"Error: inout on return means inout must be on a parameter as well for inout
inout(int)()".

What am I doing wrong? TDPL has a very similar example...

Regards,
Claudiu

P.S. Is there a netiquette (a la C++ FAQ lite) about posting on this forum
that I should be aware of?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20110617/4f898521/attachment-0001.html>


More information about the Digitalmars-d-learn mailing list