Skip to content

Commit

Permalink
Fixed long lines in std/algorithm/iteration.d
Browse files Browse the repository at this point in the history
  • Loading branch information
JackStouffer committed May 11, 2016
1 parent 478d08d commit 3890f5d
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions std/algorithm/iteration.d
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,13 @@ private struct _Cache(R, bool bidir)
CacheTypes caches;

static assert(isAssignable!(UE, E) && is(UE : E),
algoFormat("Cannot instantiate range with %s because %s elements are not assignable to %s.", R.stringof, E.stringof, UE.stringof));
algoFormat(
"Cannot instantiate range with %s because %s elements are not assignable to %s.",
R.stringof,
E.stringof,
UE.stringof
)
);
}

this(R range)
Expand Down Expand Up @@ -2669,7 +2675,13 @@ template reduce(fun...) if (fun.length >= 1)
foreach (i, f; binfuns)
{
static assert(!is(typeof(f(args[i], e))) || is(typeof(args[i] = f(args[i], e))),
algoFormat("Incompatible function/seed/element: %s/%s/%s", fullyQualifiedName!f, Args[i].stringof, E.stringof));
algoFormat(
"Incompatible function/seed/element: %s/%s/%s",
fullyQualifiedName!f,
Args[i].stringof,
E.stringof
)
);
}

static if (mustInitialize) if (initialized == false)
Expand All @@ -2684,7 +2696,9 @@ template reduce(fun...) if (fun.length >= 1)
foreach (i, f; binfuns)
args[i] = f(args[i], e);
}
static if (mustInitialize) if (!initialized) throw new Exception("Cannot reduce an empty iterable w/o an explicit seed value.");
static if (mustInitialize)
if (!initialized)
throw new Exception("Cannot reduce an empty iterable w/o an explicit seed value.");

static if (Args.length == 1)
return args[0];
Expand Down Expand Up @@ -2968,7 +2982,12 @@ private template ReduceSeedType(E)
ReduceSeedType s = ReduceSeedType.init;
static assert(is(typeof({ReduceSeedType s = lvalueOf!E;})) &&
is(typeof(lvalueOf!ReduceSeedType = fun(lvalueOf!ReduceSeedType, lvalueOf!E))),
algoFormat("Unable to deduce an acceptable seed type for %s with element type %s.", fullyQualifiedName!fun, E.stringof));
algoFormat(
"Unable to deduce an acceptable seed type for %s with element type %s.",
fullyQualifiedName!fun,
E.stringof
)
);
}
}

Expand Down Expand Up @@ -4231,8 +4250,14 @@ private struct SplitterResult(alias isTerminator, Range)
import std.uni : isWhite;

//@@@6791@@@
assert(equal(splitter("là dove terminava quella valle"), ["", "dove", "terminava", "quella", "valle"]));
assert(equal(splitter!(std.uni.isWhite)("là dove terminava quella valle"), ["", "dove", "terminava", "quella", "valle"]));
assert(equal(
splitter("là dove terminava quella valle"),
["", "dove", "terminava", "quella", "valle"]
));
assert(equal(
splitter!(std.uni.isWhite)("là dove terminava quella valle"),
["", "dove", "terminava", "quella", "valle"]
));
assert(equal(splitter!"a=='本'"("日本語"), ["", ""]));
}

Expand Down

0 comments on commit 3890f5d

Please sign in to comment.