opIn_r not detected

Stewart Gordon smjg_1998 at yahoo.com
Thu Feb 10 10:43:19 PST 2011


On 10/02/2011 12:59, spir wrote:
> Hello,
>
> Implicite deref of struct pointers on member access works fine for data, methods, even
> special methods with language semantics like opEquals (see example below).
> But I cannot have 'in' work with method opIn_r. I get:
> Error: rvalue of in expression must be an associative array, not S*
> What do I have wrong? Or is it a bug: the compiler does not even search the struct for
> opIn_r? But then, why does it do it for opEquals?
<snip>

That got me thinking.  It would appear that it auto-dereferences only the left operand. 
Try adding this to your code and see:

     writeln(s2 == sp);

Stewart.


More information about the Digitalmars-d-learn mailing list