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

Lurker via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 14 13:33:00 PST 2017


On Tuesday, 14 February 2017 at 16:25:17 UTC, Andrei Alexandrescu 
wrote:
> Range remove
> (SwapStrategy s = SwapStrategy.stable, Range, Offset...)
> (Range range, Offset offset)
> if (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 CanRemove!(s, range, offset);

> The function name is on the first line. I think 10 seconds 
> would be an exaggeration of an admittedly real issue.
>

Thought so, too, but then I *did* spend 10 seconds trying to find 
it myself!

> Tuple!(InputRange1, InputRange2)
> swapRanges(InputRange1, InputRange2)(InputRange1 r1, 
> InputRange2 r2)
> if (isInputRange!(InputRange1) && isInputRange!(InputRange2)
>     && hasSwappableElements!(InputRange1)
>     && hasSwappableElements!(InputRange2)
>     && is(ElementType!(InputRange1) == 
> ElementType!(InputRange2)));
>

Tuple!(InputRange1, InputRange2)
swapRanges(InputRange1, InputRange2)(InputRange1 r1, InputRange2 
r2)
if CanSwapRanges!(InputRange1, InputRange2);


More information about the Digitalmars-d mailing list