Skip to content

Commit d7bee22

Browse files
committed
Add link, tweak default opEquals wording
1 parent fc61d88 commit d7bee22

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

spec/expression.dd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,8 @@ $(GNAME EqualExpression):
681681

682682
$(P For struct objects, equality means the result of the
683683
$(LINK2 https://dlang.org/spec/operatoroverloading.html#equals, `opEquals()` member function).
684-
If an `opEquals()` is not provided, equality is defined as
685-
the logical product of all equality
684+
If an `opEquals()` is not provided, one will be generated.
685+
Equality is defined as the logical product of all equality
686686
results of the corresponding object fields.
687687
)
688688

spec/operatoroverloading.dd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ $(H2 $(LNAME2 eqcmp, Overloading the Comparison Operators))
388388

389389
$(P Therefore, it is the programmer's responsibility to ensure that
390390
`opCmp` and $(D opEquals) are consistent with each other. If
391-
`opEquals` is not specified, the compiler provides a default version for structs
391+
`opEquals` is not specified for a struct, the compiler provides a
392+
$(DDSUBLINK spec/expression, struct_equality, default version) of it
392393
that does member-wise comparison. If this suffices, one may define only
393394
$(D opCmp) to customize the behaviour of the *RelExpression* operators. But
394395
if not, then a custom version of $(D opEquals) should be defined as

0 commit comments

Comments
 (0)