2002 2003 2004 <2005> 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 | Index | 2002 2003 2004 <2005> 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: data access structures, strings |
From: | Marty Kraimer <[email protected]> |
To: | [email protected] |
Date: | Wed, 28 Sep 2005 08:06:48 -0500 |
Jeff Hill wrote:
Please pardon an internal debate converted to a mail message :-)Use 'assign' instead of 'operator =', 'isEqual' instead of 'operator ==',Shouldn't this also apply to dataAccess? {Or should I say :-) }PropertyCatalog currently has "operator =" and "operator ==".O Do they meet the conventional wisdom test? That is, is their purpose roughly equivalent to the purpose of these operators with primitive types? I Originally I thought yes, but I have thought about this further and its probably more accurate to call 'operator =' "extract what's in the LHS from the RHS", and what 'operator ==' does "return true if everything in the LHSis equivalent in the RHS".
Should == (or equals) always guarantee that it is an equivalence relation? That is 1) reflexive => x==x is always true 2) symetric => if x==y then y==x 3) transitive => if x==y and y==z then x==zJava states that if a class overrides equals it should gurantee that its implementation is an equivalence relation.
I suspect similar advice appears somewhere for C++. dataAccess == does not appear to be symetric If containers are implemented for struct A { int x; int y} and struct B {int x; int y; int z} Then won't the following happen if A.x=B.x and A.y=B.y? A==B is true but B==A is false Marty