How to using opCmp

Manfred_Nowak svv1999 at hotmail.com
Sat Dec 17 08:11:42 PST 2011


Heromyth wrote:

> I can use it like this:
>    int b = t1.opCmp(info);
> and is it right like this:
>    int b = t1 < info;
> 
> In my test code, I get different value for b. What can I do?

Nothing because the call of the operator `<' interprets the result of the 
call of `opCmp', which is constant in this case!

Remember that the result of `opCmp' is used for at least the operators `<', 
`>', `<=' and `>='.

-manfred
 


More information about the Digitalmars-d-learn mailing list