chaining chain Result and underlying object of chain
anonymous via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Sep 14 07:31:31 PDT 2015
On Monday 14 September 2015 16:17, Laeeth Isharc wrote:
> chain doesn't seem to compile if I try and chain a chain of two
> strings and another string.
>
> what should I use instead?
Please show code, always.
A simple test works for me:
----
import std.algorithm: equal;
import std.range: chain;
void main()
{
auto chain1 = chain("foo", "bar");
auto chain2 = chain(chain1, "baz");
assert(equal(chain2, "foobarbaz"));
}
----
More information about the Digitalmars-d-learn
mailing list