Abstract
Two managed objects are said to be equal if their values are same. The System::Object’s Equals method can be used to test equivalence. The Equals is an instance virtual method and can be overridden in a derived class/struct because equality of compound objects depends on the type. Two managed objects are said to be identical if their references point to the same object on the heap. The System::Object’s ReferenceEquals static method can be used to test identity.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2016 Vivek Ragunathan
About this chapter
Cite this chapter
Ragunathan, V. (2016). Equality and Identity. In: C++/CLI Primer. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-2367-3_16
Download citation
DOI: https://doi.org/10.1007/978-1-4842-2367-3_16
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-2366-6
Online ISBN: 978-1-4842-2367-3
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books