[Issue 5310] New: Variant == const(Variant) doesn't compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 2 13:24:44 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=5310

           Summary: Variant == const(Variant) doesn't compile
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: clugdbug at yahoo.com.au


--- Comment #0 from Don <clugdbug at yahoo.com.au> 2010-12-02 13:23:11 PST ---
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))
)
----

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list