Template function alias that leaves out the last type parameter

torhu torhu at yahoo.com
Tue Sep 27 22:39:52 UTC 2022


How would I achieve something like this, do I have to turn the 
aliases into functions?

```d
void _messageBox(string title, int style, T...)(T args)
{
     string s = format(args);
     /* etc... */
}

alias _messageBox!(APPNAME, SWT.ICON_INFORMATION) info;
alias _messageBox!("Warning", SWT.ICON_WARNING) warning;
alias _messageBox!("Error", SWT.ICON_ERROR) error;
```



More information about the Digitalmars-d-learn mailing list