On Tuesday, 2 February 2016 at 13:20:33 UTC, Voitech wrote:
Hi, Is it possible to bound T... in template with some type ? For single Parameter declaration it can be done by T:SomeType but variadics does not seems to have that possibility ?Cheers
import std.stdio; import std.meta: allSatisfy; import std.traits; void some(T...)(T Args) if (allSatisfy!(isIntegral,T)) { writeln(Args); } void main() { some(1); some(1,2,3); some(1,2,3.0); // error }