mirror of
https://github.com/dlang/phobos.git
synced 2025-05-07 11:37:24 +03:00
Added documentation to undocumented overload of std.algorithm.joiner.
This commit is contained in:
parent
1980e72fc4
commit
2b9d1552b3
1 changed files with 5 additions and 1 deletions
|
@ -2216,7 +2216,8 @@ unittest
|
||||||
// joiner
|
// joiner
|
||||||
/**
|
/**
|
||||||
Lazily joins a range of ranges with a separator. The separator itself
|
Lazily joins a range of ranges with a separator. The separator itself
|
||||||
is a range.
|
is a range. If you do not provide a separator, then the ranges are
|
||||||
|
joined directly without anything in between them.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
----
|
----
|
||||||
|
@ -2227,6 +2228,7 @@ assert(equal(joiner(["abc", ""], "xyz"), "abcxyz"));
|
||||||
assert(equal(joiner(["abc", "def"], "xyz"), "abcxyzdef"));
|
assert(equal(joiner(["abc", "def"], "xyz"), "abcxyzdef"));
|
||||||
assert(equal(joiner(["Mary", "has", "a", "little", "lamb"], "..."),
|
assert(equal(joiner(["Mary", "has", "a", "little", "lamb"], "..."),
|
||||||
"Mary...has...a...little...lamb"));
|
"Mary...has...a...little...lamb"));
|
||||||
|
assert(equal(joiner(["abc", "def"]), "abcdef"));
|
||||||
----
|
----
|
||||||
*/
|
*/
|
||||||
auto joiner(RoR, Separator)(RoR r, Separator sep)
|
auto joiner(RoR, Separator)(RoR r, Separator sep)
|
||||||
|
@ -2358,6 +2360,7 @@ unittest
|
||||||
assert(equal(joiner(["abc", "def"], "xyz"), "abcxyzdef"));
|
assert(equal(joiner(["abc", "def"], "xyz"), "abcxyzdef"));
|
||||||
assert(equal(joiner(["Mary", "has", "a", "little", "lamb"], "..."),
|
assert(equal(joiner(["Mary", "has", "a", "little", "lamb"], "..."),
|
||||||
"Mary...has...a...little...lamb"));
|
"Mary...has...a...little...lamb"));
|
||||||
|
assert(equal(joiner(["abc", "def"]), "abcdef"));
|
||||||
}
|
}
|
||||||
|
|
||||||
unittest
|
unittest
|
||||||
|
@ -2367,6 +2370,7 @@ unittest
|
||||||
assert (equal(joiner(r, "xyz"), "abcxyzdef"));
|
assert (equal(joiner(r, "xyz"), "abcxyzdef"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Ditto
|
||||||
auto joiner(RoR)(RoR r)
|
auto joiner(RoR)(RoR r)
|
||||||
if (isInputRange!RoR && isInputRange!(ElementType!RoR))
|
if (isInputRange!RoR && isInputRange!(ElementType!RoR))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue