Reputation: 10830
Can the ==
operator be overloaded so as to compare two char[]
using a string comparison?
Upvotes: 4
Views: 1512
Reputation: 355187
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.
Upvotes: 9