Traits

Jonathan M Davis jmdavisProg at gmx.com
Thu Oct 10 22:44:50 PDT 2013


On Thursday, October 10, 2013 21:35:37 Ali Çehreli wrote:
> One of the uses of the is expression determines "whether implicitly
> convertible to". It may work for you:
> 
> public void foo(T, A...)(auto ref A values)
> {
>      static assert(is (T : L));
> }

Actually, checking for implicit conversion will work directly in the template 
signature without a template constraint or static assertion. e.g.

public void foo(T : L, A...)auto ref A values)
{
}

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list