Two functions with different args. Taking address of the one

Dennis dkorpel at gmail.com
Thu Mar 11 13:29:42 UTC 2021


On Thursday, 11 March 2021 at 12:56:34 UTC, Виталий Фадеев wrote:
> What right way to call function directly with selecting one of 
> two ?

If they are not nested functions, you can also do:
```
// Separate names
void processKey (ref MouseKeyEvent event) {...}
void processMove(ref MouseMoveEvent event) {...}

// Still create overload set
alias process = processKey;
alias process = processMove;

_processMouseKey  = &processKey;
_processMouseMove = &processMove;
```



More information about the Digitalmars-d-learn mailing list