On Saturday, 28 July 2012 at 16:47:48 UTC, Simen Kjaeraas wrote:
On Sat, 28 Jul 2012 18:17:14 +0200, Zhenya <zh...@list.ru>
wrote:
Why do not D allow templates with more than one tuple
parameters,at the
same time that C++11 support it:
Well, Walter implemented type tuples with automatic flattening,
back when dinosaurs roamed the earth (we now help people who
have
questions). We've lived with that decision since then, and
though
there are times when a non-flattening system would have been
nice,
it's easy enough to work around:
template NonFlatteningTuple( T... ) {
alias T types;
}
template Foo( T, U ) {
// Do things with T.types and U.types here
}
Foo!( NonFlatteningTuple!(int, float), NonFlatteningTuple!() );
But function template can deduce types without explicit
instansiation,regular template can't.