[Issue 5638] Auto-flattening std.range.chain()

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 19 16:14:13 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=5638


Infiltrator <lt.infiltrator at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |lt.infiltrator at gmail.com
         Resolution|                            |WORKSFORME


--- Comment #1 from Infiltrator <lt.infiltrator at gmail.com> 2014-03-19 16:14:10 PDT ---
For the examples you provided, v2.065 gives the same typeid for all of them:

--------------------------------------------------------------------
import std.range, std.stdio;
void main() {
    auto c1 = chain(chain([1, 2]), [3, 4]);
    writeln(c1);
    writefln("chain(chain, range): %s", typeid(typeof(c1)));

    auto c2 = chain([1, 2], chain([3, 4]));
    writeln(c2);
    writefln("chain(range, chain): %s", typeid(typeof(c2)));

    auto c3 = chain(chain([1, 2]), chain([3, 4]));
    writeln(c3);
    writefln("chain(chain, chain): %s", typeid(typeof(c3)));
}
--------------------------------------------------------------------
Application output:

[1, 2, 3, 4]
chain(chain, range): std.range.chain!(int[], int[]).chain.Result
[1, 2, 3, 4]
chain(range, chain): std.range.chain!(int[], int[]).chain.Result
[1, 2, 3, 4]
chain(chain, chain): std.range.chain!(int[], int[]).chain.Result

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list