Multiple Template Specialization Types (in D1)?

BCS ao at pathlink.com
Tue Jul 1 14:45:02 PDT 2008


Reply to Nick,

> Is there a way to do something like this in D1 without resorting to
> function overloading?:
> 
> void Foo(T : char, wchar, dchar)(T arg) {/*code*/}
> 

public template Foo(T: char) {alias Foo_dwc(T) Foo; }
public template Foo(T: wchar) {alias Foo_dwc(T) Foo; }
public template Foo(T: dchar) {alias Foo_dwc(T) Foo; }

private void Foo_dwc(T)(T arg) { ... }




More information about the Digitalmars-d-learn mailing list