Testing for template argument being result of takeExactly

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Sep 23 06:48:30 PDT 2012


On 9/23/12 8:47 AM, Timon Gehr wrote:
> import std.range, std.traits;
> import std.stdio;
> template Hello(R) if(is(typeof(R._input.takeExactly(2)) == R)){
> alias R Hello;
> }

That's the nicest. Regarding availability of "_input", I meant to make 
it available systematically as "input" for ranges where the notion makes 
sense.

Andrei


More information about the Digitalmars-d-learn mailing list