On Tue, 2 Dec 2014 14:00:09 -0800
"H. S. Teoh via Digitalmars-d" <digitalmars-d@puremagic.com> wrote:

>       // mymod.d
>       module mymod;
>       struct S {
>               // Now everyone is happy, right...?
>               import std.range : isInputRange;
> 
>               void method(R)(R range)
>                       if (isInputRange!R)
>               {
>               }
>       }
ah, how i HAET that! importing std.traits in module scope just to have
preconditions in templates drives me mad. i want to be able to insert
import statements before that `if`! and i want that imports to not
affect template body too.

sure, i can do hacks with lambdas here, but i want the code to be
easily readable -- that's why we have that cool `if` conditions there!

Attachment: signature.asc
Description: PGP signature

Reply via email to