File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -686,6 +686,21 @@ $(GNAME EqualExpression):
686
686
results of the corresponding object fields.
687
687
)
688
688
689
+ $(SPEC_RUNNABLE_EXAMPLE_RUN
690
+ ---
691
+ struct S
692
+ {
693
+ int i = 4;
694
+ string s = "four";
695
+ }
696
+
697
+ S s;
698
+ assert(s == S());
699
+ s.s = "foul";
700
+ assert(s != S());
701
+ ---
702
+ )
703
+
689
704
$(IMPLEMENTATION_DEFINED The contents of any $(DDSUBLINK spec/struct, struct_layout,
690
705
alignment gaps) in the struct object.)
691
706
Original file line number Diff line number Diff line change @@ -2534,7 +2534,9 @@ void main()
2534
2534
---
2535
2535
)
2536
2536
2537
- $(P If a struct declaration defines an $(D opCmp) or $(D opEquals)
2537
+ $(P If a struct declaration defines an
2538
+ $(DDSUBLINK spec/operatoroverloading, compare, `opCmp`) or
2539
+ $(DDSUBLINK spec/operatoroverloading, equals, `opEquals`)
2538
2540
method, it will take precedence to that of the *AliasThis* member. Note
2539
2541
that, unlike an $(D opCmp) method, an $(D opEquals) method is implicitly
2540
2542
defined for a $(D struct) declaration if a user-defined one isn't provided.
You can’t perform that action at this time.
0 commit comments