C# with dotGNU, operator overloading
I am lost, here is the code snippet:
---line 1006------ public static bool operator==(exdec lhs, exdec rhs) { return (lhs.Values == rhs.Values); } public static bool operator!=(exdec lhs, exdec rhs) { return (lhs.Values != rhs.Values); } public static bool operator<=(exdec lhs, exdec rhs) { return (lhs.Values <= rhs.Values); } public static bool operator>=(exdec lhs, exdec rhs) { return (lhs.Values >= rhs.Values); } public static bool operator>(exdec lhs, exdec rhs) { return (lhs.Values > rhs.Values); } public static bool operator<(exdec lhs, exdec rhs) { return (lhs.Values < rhs.Values); } ---line 1031------ here is my error: ./exodist.cs:1017: invalid operands to binary `<=' ./exodist.cs:1017: incompatible types in return: no conversion from `int' to `bool' ./exodist.cs:1021: invalid operands to binary `>=' ./exodist.cs:1021: incompatible types in return: no conversion from `int' to `bool' ./exodist.cs:1025: invalid operands to binary `>' ./exodist.cs:1025: incompatible types in return: no conversion from `int' to `bool' ./exodist.cs:1029: invalid operands to binary `<' ./exodist.cs:1029: incompatible types in return: no conversion from `int' to `bool' notes: line 1216 has a } closing the namespace usage declairation on line #1 Values is an integer array (int[]) inside the exdec class. why would == and != work then <= etc all fail w/ same syntax? |
I feel stupid now, I know whats wrong :-[
|
obviously I cannot simply see if an array has a greater or smaller total added value like this :-P
|
All times are GMT -5. The time now is 02:18 PM. |