On 10/02/2011 22:32, spir wrote:
On 02/10/2011 07:43 PM, Stewart Gordon wrote:
<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);
Works, indeed, but using opEquals on s2, and because s2 is not "pointed".
In what compiler version/platform?
Here's what I get (DMD 2.051, Windows, after fixing the missing import):
----------
C:\Users\Stewart\Documents\Programming\D\Tests>dmd -unittest opin_r.d
opin_r.d(19): Error: function opin_r.S.opEquals (ref const(S) s) const is not ca
llable using argument types (S*)
opin_r.d(19): Error: cannot implicitly convert expression (sp) of type S* to con
st(S)
----------
Or maybe you forgot the -unittest?
Stewart.