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