Template type deduction

Andrej Mitrovic andrej.mitrovich at gmail.com
Sun Jan 20 07:59:34 PST 2013


On 1/20/13, Phil Lavoie <maidenphil at hotmail.com> wrote:
> Imagine you have something like this:
>
> struct MyParamType( T1, T2 ) { ... }
>
> and then a compound:
>
> struct MyCoumpound( T ) if( isMyParamType!T ) { ... }

Use isInstanceOf in std.traits:

struct MyCoumpound( T ) if( isInstanceOf!(MyParamType, T) ) { ... }

On 1/20/13, Philippe Sigaud <philippe.sigaud at gmail.com> wrote:
> is(T _ : MyParamType!U, U...)
> ( '_' just to tell someone reading the code this part is not used)

This won't be necessary in the next release thanks to a pull by Kenji,
you will be able to use:
is(T : MyParamType!U, U...)


More information about the Digitalmars-d-learn mailing list