How to get number of parameters in lambda?

Paul Backus snarwin at gmail.com
Tue Mar 9 16:03:50 UTC 2021


On Tuesday, 9 March 2021 at 14:22:44 UTC, Andrey Zherikov wrote:
> In case of function template this is possible but the original 
> question was about lambdas. There is no way that lambda can 
> change number of parameters during instantiation, am I right?

Yes, you're correct. The issue is that the compiler currently 
can't tell the difference between a template lambda and a 
non-lambda function template.

This could be changed, but having a language feature that works 
for lambdas but not for named functions is probably not such a 
great idea.


More information about the Digitalmars-d-learn mailing list