Restrict type of function parameter to a defined list of types?

Martin B martin.brzenska at
Sun Dec 12 13:42:08 UTC 2021

On Sunday, 12 December 2021 at 13:21:06 UTC, Adam D Ruppe wrote:
> On Sunday, 12 December 2021 at 13:11:58 UTC, Martin B wrote:
> Just add a forwarding overload:
Hi Adam,

i am wondering if there is another possibility without having to 
create overloads for each parameter type - something like this 
Nullable!string str(T : {string, Nullable!string}) (T setter) {
     return this._str = setter;

More information about the Digitalmars-d-learn mailing list