template with more than one tuple parameter

Simen Kjaeraas simen.kjaras at gmail.com
Sat Jul 28 10:27:50 PDT 2012


On Sat, 28 Jul 2012 19:08:55 +0200, Zhenya <zheny at list.ru> wrote:

> But function template can deduce types without explicit  
> instansiation,regular template can't.

Ah, yes. I hadn't quite noticed that part. There are still
solutions, but I agree it's nowhere near as nice:

void foo( T, U )( T t, U u ) {
     static if ( is( T _ = NonFlatteningTuple!Args1, Args1... )
         && is( U _ = NonFlatteningTuple!Args2, Args2... ) {
         // Function body
     }
}

-- 
Simen


More information about the Digitalmars-d-learn mailing list