Summary: struct VariantN does not overload ()
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from Austin Hastings <> 2010-09-22 20:11:45 
PDT ---
This code:
module scratch;

import std.variant;

unittest {
    Variant v;

    int foo() { return 1; }

    v = &foo;

Produces this error:
$ dmd -unittest -run bronze/util/scratch.d
bronze\util\scratch.d(12): Error: struct VariantN does not overload ()

IMO, this is a design flaw: Variants claim to support function and delegate
pointers, and it seems obvious that supporting them should support invoking
them. (In particular, since functions and delegates are different sizes,
Variants should be very useful in this role, except ...)

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to