www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21736] New: Support struct in typesafe variadic function


          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
                OS: All
            Status: NEW
          Keywords: spec
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dfj1esp02 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?

Mar 19 2021