D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.

Issue 1853

Summary: opCmp documentation really needs some examples
Product: D Reporter: Bill Baxter <wbaxter>
Component: dlang.orgAssignee: Walter Bright <bugzilla>
Status: RESOLVED FIXED
Severity: normal
Priority: P2
Version: D1 (retired)
Hardware: x86
OS: Windows

Description Bill Baxter 2008年02月20日 01:59:07 UTC
The opCmp section really could use a struct example (and maybe a class example too).
http://www.digitalmars.com/d/1.0/operatoroverloading.html
It's not entirely obvious from the description given how you're supposed to write one, especially for a struct. I put an example on the comments page. Feel free to copy it:
http://www.prowiki.org/wiki4d/wiki.cgi?DocComments/OperatorOverloading#section4 
Comment 1 Walter Bright 2008年03月07日 00:32:38 UTC
Fixed dmd 1.028 and 2.012

AltStyle によって変換されたページ (->オリジナル) /