Is there a way to
Kyle Ingraham
kyle at kyleingraham.com
Sat Sep 10 23:37:30 UTC 2022
Is there a way to write a delegate type as being specific for
some parameters and tolerant of anything for others? For example,
I can specify this type:
```d
alias MyDelegateType = void delegate(string name, int age);
```
It would be compatible with a pointer to this function converted
to a delegate:
```d
void someFunc(string name, int age) { // }
```
That type would not work for this function though:
```d
void anotherFunc(string name, int age, string location) { // }
```
How can I write a type that is strict for the first two
parameters but tolerant of any other parameter following those?
More information about the Digitalmars-d-learn
mailing list