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?
Last edited by exodist; 03-15-2004 at 05:42 PM.
|