Is there a way to make a function parameter accept only values that can be checked at compile time?

Ali Çehreli acehreli at yahoo.com
Tue Dec 28 22:30:30 UTC 2021


On 12/28/21 2:06 PM, Steven Schveighoffer wrote:

>>    void print_num(int mul)(int num) {

Wasn't there a way of telling whether an 'auto ref' parameter is copied 
or not?

void print_num()(int num, auto ref int mul) {
   // ?
}

And that would indicate  that the argument was an rvalue?

I realize that rvalues are not exactly what the OP is interested in.

Ali



More information about the Digitalmars-d-learn mailing list