[Issue 21736] New: Support struct in typesafe variadic function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 19 19:22:10 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21736

          Issue ID: 21736
           Summary: Support struct in typesafe variadic function
           Product: D
           Version: D2
          Hardware: All
               URL: https://dlang.org/spec/function.html#typesafe_variadic
                    _functions
                OS: All
            Status: NEW
          Keywords: spec
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dfj1esp02 at sneakemail.com

struct A
{
        int a;
}
int f(A a...){ return a.a; }
static assert(f(4)==4); //not callable

Typesafe variadic functions are supported with classes, but not with structs.
Is there a reason for this limitation?

--


More information about the Digitalmars-d-bugs mailing list