Bug 3729 – Can't define opEquals for immutable types

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-01-20T11:26:00Z
Last change time
2015-06-09T01:27:22Z
Assigned to
nobody
Creator
tomeksowi

Comments

Comment #0 by tomeksowi — 2010-01-20T11:26:17Z
immutable struct S { bool opEquals(ref S s) { ... } } The above doesn't compile, as the parameter is required to be const and the function to be const as well and it's immutable in both cases. Since an immmutable type can't be less than immutable such a requirement is pointless.
Comment #1 by yebblies — 2011-06-12T22:44:10Z
*** This issue has been marked as a duplicate of issue 3659 ***