Re: op_Equality (== Operator) for Value-Types
- From: Chris Nahr <diogenes@xxxxxxxxxxxxx>
- Date: Tue, 20 Mar 2007 13:26:29 +0100
On Tue, 20 Mar 2007 16:39:17 +0530, "MasterGaurav
\(www.edujini-labs.com\)" <gaurav.vaish.nospam@xxxxxxxxxxxxxxxx>
wrote:
Why cannot I use the == operator directly for value-types (not primitive
types like int, float, double etc)? Why do I need to either have an implicit
operator (to type-cast to primitive type) or override/overlaod the ==
operator myself?
I'm assuming what you want is a default definition of operator== for
value types that does a bitwise comparison of all member variables.
I agree that would have been convenient since it's normally exactly
what you want. No idea why the .NET team didn't do that. They might
have judged it not worth the effort since user-defined value types are
(or should be) rare.
--
http://www.kynosarges.de
.
- References:
- op_Equality (== Operator) for Value-Types
- From: MasterGaurav \(www.edujini-labs.com\)
- op_Equality (== Operator) for Value-Types
- Prev by Date: Re: How to get current drive mapping
- Next by Date: Re: op_Equality (== Operator) for Value-Types
- Previous by thread: op_Equality (== Operator) for Value-Types
- Next by thread: Re: op_Equality (== Operator) for Value-Types
- Index(es):
Relevant Pages
|