Bug 11324 – swap does not support types that aren't assignable

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-22T09:35:00Z
Last change time
2013-10-22T09:40:29Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
monarchdodra

Comments

Comment #0 by monarchdodra — 2013-10-22T09:35:26Z
unittest { static struct NoAssign { int i; void opAssign(NoAssign) @disable; } auto s1 = NoAssign(1); auto s2 = NoAssign(2); swap(s1, s2); //Fails assert(s1.i == 2); assert(s2.i == 1); }
Comment #1 by monarchdodra — 2013-10-22T09:36:07Z