Can operator == be overloaded so as to compare 2 char[] using a string comparison.
+6
A:
No; at least one parameter of an operator overload must be of class or enumeration type.
char[] and char* are array and pointer types, which are not class or enumeration types.
James McNellis
2010-06-06 19:11:31
...only be overloaded where at least one parameter is of class type, I would have said.
anon
2010-06-06 19:13:25
... and in addition enumeration types.
Johannes Schaub - litb
2010-06-06 19:14:40
@Neil: That would certainly be clearer and more correct. Fixed and thanks. @Johannes: That too. *sigh* well, this answer started off pretty poorly. :(
James McNellis
2010-06-06 19:15:11
@James: All is well that ends well.
sbi
2010-06-06 20:55:17