syntax sugar: std.path::buildPath instead of from!"std.path".buildPath

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 14 17:09:59 PST 2017


On Tue, 14 Feb 2017 19:08:53 +0000, bachmeier wrote:
> I am not familiar with all of the past discussion of this issue, but
> something that I have wondered is why we can't do something like
> 
> alias fooConstraint = (s != SwapStrategy.stable
>    && isBidirectionalRange!Range && hasLvalueElements!Range &&
>    hasLength!Range && Offset.length >= 1);
> 
> Range remove
>    (SwapStrategy s = SwapStrategy.stable, Range, Offset...)
>    (Range range, Offset offset) if fooConstraint;

Because now I have to look up the definition of fooConstraint and then I 
have to look up the definition of each element within it.

If the entirety of the constraint is in the body of that helper template, 
that's a step up from what we have today. But that would involve code 
duplication, which people tend to dislike.


More information about the Digitalmars-d mailing list