How to get type qualifiers of D-style variadic parameter

IchorDev a at a.a
Thu May 7 14:22:08 UTC 2026


On Tuesday, 5 May 2026 at 03:52:32 UTC, H. S. Teoh wrote:
> void fnA(const int param1){}
> void fnB(immutable int param1){}
> void fnC(shared int param1){}
> void fnD(shared int param1, const float param2, immutable 
> double param3, int x){}

You should probably read the question before posting an utterly 
unhelpful answer like this. In case I was not abundantly clear by 
putting it in my subject, question, and my example code: I am 
looking for help with reading the type qualifiers of **D-style 
variadic parameters**. Trivially modifying your code to check 
**D-style variadic parameters** makes it fail to even compile 
because `__parameters` *does not return variadic parameters* in 
the first place:
```
onlineapp.d(3): Error: sequence index `0` out of bounds `[0 .. 0]`
         alias Param = Params[paramIdx];
         ^
onlineapp.d(23): Error: template instance 
`onlineapp.getParamTypeQualifier!(void(const ...), 0LU)` error 
instantiating
pragma(msg, getParamTypeQualifier!(typeof(fnA), 0));
             ^
onlineapp.d(23):        while evaluating `pragma(msg, 
getParamTypeQualifier!(void(const ...), 0LU))`
pragma(msg, getParamTypeQualifier!(typeof(fnA), 0));
^
onlineapp.d(24):        while evaluating `pragma(msg, 
getParamTypeQualifier!(void(const ...), 0LU))`
pragma(msg, getParamTypeQualifier!(typeof(fnB), 0));
^
onlineapp.d(25):        while evaluating `pragma(msg, 
getParamTypeQualifier!(void(const ...), 0LU))`
pragma(msg, getParamTypeQualifier!(typeof(fnC), 0));
^
```


More information about the Digitalmars-d-learn mailing list