Type qualifiers - inout error
Steven Schveighoffer
schveiguy at yahoo.com
Fri Jun 17 03:33:59 PDT 2011
On Thu, 16 Jun 2011 22:12:49 -0400, bearophile <bearophileHUGS at lycos.com>
wrote:
> Claudiu Verdes:
>
>> What am I doing wrong? TDPL has a very similar example...
>
> I think this TDPL example is not good. And generally inout is not fully
> implemented in D yet.
Yes, a better example would be:
class A
{
ref inout(int) val() inout
{
return _val;
}
private int _val;
}
inout is only relevant if the data type being returned has a reference in
it, because a value-only type is implicitly castable to any constancy
(const, immutable, or mutable).
As bearophile says, inout is not properly implemented yet.
-Steve
More information about the Digitalmars-d-learn
mailing list