splitter overload with terminator predicate requires forward range
Luís Marques via Digitalmars-d
digitalmars-d at puremagic.com
Mon Dec 14 05:06:30 PST 2015
The documentation for one of the overloads of
std.algorithm.splitter claims to require an input range in the
Parameters section, and a forward range in the function signature
(template constraint) section:
auto splitter(alias isTerminator, Range)(Range input) if
(isForwardRange!Range &&
is(typeof(unaryFun!isTerminator(input.front))));
Parameters:
isTerminator The predicate for deciding where to split the
range.
Range input The input range to be split.
Returns:
An input range of the subranges of elements between
separators. If input is a forward range or bidirectional range,
the returned range will be likewise
Is this a documentation bug? In any case, I would like to use
this variant of splitter (a range and a predicate), but I only
have an input range (because of `tee`) and the template
constraint rejects that, so changing that requirement would be
nice.
More information about the Digitalmars-d
mailing list