471,570 Members | 902 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,570 software developers and data experts.

"bitwise equality" with value types?

KJ
Given a struct containing only primitive members, does "bitwise
equality" mean that it is not necessary to override Object Equals() or
the == operator when all you want to do is determine equivalence by
comparing the values of each primitive in the struct? The docs seem to
suggest this, but I would like a confirmation, if possible.

Thanks.

-KJ

Dec 16 '05 #1
2 1771
Hi,

It's indeed the way it works, even if there is a reference type if both
structs have the same reference they will be equals
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"KJ" <n_**********@mail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Given a struct containing only primitive members, does "bitwise
equality" mean that it is not necessary to override Object Equals() or
the == operator when all you want to do is determine equivalence by
comparing the values of each primitive in the struct? The docs seem to
suggest this, but I would like a confirmation, if possible.

Thanks.

-KJ

Dec 16 '05 #2
KJ
Awesome, thanks.

-KJ

Dec 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Quentin Crain | last post: by
8 posts views Thread by J. Campbell | last post: by
188 posts views Thread by infobahn | last post: by
15 posts views Thread by Bobby C. Jones | last post: by
4 posts views Thread by Robert W. | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.