mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 22:50:38 +03:00
Better std.algorithm.iteration.filter error messages
This commit is contained in:
parent
2deea50438
commit
8546da5b04
2 changed files with 25 additions and 3 deletions
|
@ -2969,10 +2969,24 @@ iterated from the back to the front, the separator will still be consumed from
|
|||
front to back, even if it is a bidirectional range too.
|
||||
*/
|
||||
auto joiner(RoR, Separator)(RoR r, Separator sep)
|
||||
if (isInputRange!RoR && isInputRange!(ElementType!RoR)
|
||||
&& isForwardRange!Separator
|
||||
&& is(ElementType!Separator : ElementType!(ElementType!RoR)))
|
||||
{
|
||||
static assert(isInputRange!RoR, "The type of RoR '", RoR.stringof
|
||||
, " must be an InputRange (isInputRange!", RoR.stringof, ").");
|
||||
static assert(isInputRange!(ElementType!RoR), "The ElementyType of RoR '"
|
||||
, ElementType!(RoR).stringof, "' must be an InputRange "
|
||||
, "(isInputRange!(ElementType!(", RoR.stringof , "))).");
|
||||
static assert(isForwardRange!Separator, "The type of the Seperator '"
|
||||
, Seperator.stringof, "' must be a ForwardRange (isForwardRange!("
|
||||
, Seperator.stringof, ")).");
|
||||
static assert(is(ElementType!Separator : ElementType!(ElementType!RoR))
|
||||
, "The type of the elements of the separator range does not match "
|
||||
, "the type of the elements that are joined. Separator type '"
|
||||
, ElementType!(Separator).stringof, "' is not implicitly"
|
||||
, "convertible to range element type '"
|
||||
, ElementType!(ElementType!RoR).stringof, "' (is(ElementType!"
|
||||
, Separator.stringof, " : ElementType!(ElementType!", RoR.stringof
|
||||
, "))).");
|
||||
|
||||
static struct Result
|
||||
{
|
||||
private RoR _items;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue