template with more than one tuple parameter

Zhenya zheny at list.ru
Sat Jul 28 11:21:51 PDT 2012


On Saturday, 28 July 2012 at 17:28:21 UTC, Simen Kjaeraas wrote:
> 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
>     }
> }

Thank you,understood/


More information about the Digitalmars-d-learn mailing list