[comp.lang.c++] C++ default comparison operator

alex@cca.CCA.COM (Alexis Layton) (05/24/88)

Now that structure/class assignment is defined as (recursive) memberwise
assignment in the absense of assignment operators, I wonder if a similar
recursive memberwise definition of equality comparison is not in order.
What are the stylistic, semantic, and implementation-specific arguments
for and against such a feature?

ark@alice.UUCP (05/24/88)

In article <28535@cca.CCA.COM>, alex@cca.UUCP writes:


> Now that structure/class assignment is defined as (recursive) memberwise
> assignment in the absense of assignment operators, I wonder if a similar
> recursive memberwise definition of equality comparison is not in order.
> What are the stylistic, semantic, and implementation-specific arguments
> for and against such a feature?


The main argument against it is that C does not have
a default structure comparison operator.

henry@utzoo.uucp (Henry Spencer) (05/25/88)

> Now that structure/class assignment is defined as (recursive) memberwise
> assignment in the absense of assignment operators, I wonder if a similar
> recursive memberwise definition of equality comparison is not in order.
> What are the stylistic, semantic, and implementation-specific arguments
> for and against such a feature?

Here's one against:  how do you compare unions?
-- 
NASA is to spaceflight as            |  Henry Spencer @ U of Toronto Zoology
the Post Office is to mail.          | {ihnp4,decvax,uunet!mnetor}!utzoo!henry

karl@haddock.ISC.COM (Karl Heuer) (06/01/88)

In article <1988May24.170429.994@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:
>[some unattributed person notes that struct/class assignment is now defined
>as recursive memberwise assignment, and asks about extending this concept to
>equality comparison]
>
>Here's one against:  how do you compare unions?

Why should the compare feature include unions?  Surely, unions aren't covered
by the new assignment feature.

Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint