Bug 5310 – Variant == const(Variant) doesn't compile

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-12-02T13:23:00Z
Last change time
2013-02-24T16:51:31Z
Assigned to
andrei
Creator
clugdbug

Comments

Comment #0 by clugdbug — 2010-12-02T13:23:11Z
import std.variant; void foo(const Variant a) { Variant b; assert (a == b); } --- >dmd test0 test0.d(12): Error: template std.variant.VariantN!(maxSize).VariantN.opEquals(T ) does not match any function template declaration test0.d(12): Error: template std.variant.VariantN!(maxSize).VariantN.opEquals(T ) cannot deduce template function from argument types !()(VariantN!(maxSize)) And if you change the assert into: assert(b==a); you get: c:\dmd\windows\bin\..\..\src\phobos\std\variant.d(499): Error: static assert "A ssigning Variant objects from const Variant objects is currently not supported." c:\dmd\windows\bin\..\..\src\phobos\std\variant.d(481): instantiated from here: opAssign!(const(VariantN!(maxSize))) c:\dmd\windows\bin\..\..\src\phobos\std\variant.d(737): instantiated from here: __ctor!(const(VariantN!(maxSize))) test0.d(12): instantiated from here: opEquals!(const(VariantN!(maxSize)) ) ----
Comment #1 by github-bugzilla — 2013-02-24T16:51:31Z