Thread overview | |||||
---|---|---|---|---|---|
|
November 14, 2011 [Issue 6948] New: Possible bug in compiler or documentation regarding signature of opCmp() | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=6948 Summary: Possible bug in compiler or documentation regarding signature of opCmp() Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: kukac@mailinator.com --- Comment #0 from kukac@mailinator.com 2011-11-14 13:07:07 PST --- The documentation http://www.digitalmars.com/d/2.0/arrays.html writes that "For the .sort property to work on arrays of structs or unions, the struct or union definition must define the function: int opCmp(S) or int opCmp(S*)". That is misleading, as, in my experience, a struct must implement exactly "int opCmp(ref const S) const" in order to get .sort work. Signatures which are a bit different do not work. The documentation should be updated as soon as possible, either informing the programmer about a current bug in the compiler, or clearly stating that only this signature works! In addition, I think that the compiler should warn about using a likely incorrect signature. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 14, 2011 [Issue 6948] Possible bug in compiler or documentation regarding signature of opCmp() | ||||
---|---|---|---|---|
| ||||
Posted in reply to kukac@mailinator.com | http://d.puremagic.com/issues/show_bug.cgi?id=6948 Alex Rønne Petersen <xtzgzorex@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xtzgzorex@gmail.com --- Comment #1 from Alex Rønne Petersen <xtzgzorex@gmail.com> 2011-11-14 13:20:44 PST --- It is by design that only that specific overload works (see The D Programming Language). The documentation is wrong here. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 21, 2012 [Issue 6948] Possible bug in compiler or documentation regarding signature of opCmp() | ||||
---|---|---|---|---|
| ||||
Posted in reply to kukac@mailinator.com | http://d.puremagic.com/issues/show_bug.cgi?id=6948 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |spec Status|NEW |RESOLVED CC| |bugzilla@digitalmars.com Resolution| |FIXED --- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2012-01-21 01:02:40 PST --- https://github.com/D-Programming-Language/d-programming-language.org/commit/955530833c2221e934f24dd4f0c431b724e4db58 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation