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 LHS
is 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==z
Java 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
- Replies:
- RE: data access structures, strings Jeff Hill
- Re: data access structures, strings Benjamin Franksen
- References:
- RE: data access structures, strings Jeff Hill
- Navigate by Date:
- Prev:
Re: data access structures, strings Kay-Uwe Kasemir
- Next:
Re: ICALEPCS 2005: EPICS workshop: EPICS V4 Runtime Database Marty Kraimer
- Index:
2002
2003
2004
<2005>
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
RE: data access structures, strings Jeff Hill
- Next:
RE: data access structures, strings Jeff Hill
- Index:
2002
2003
2004
<2005>
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|