Thread overview
[Issue 22002] std.algorithm.each breaks when used with InputRangeObject
Sep 18, 2021
mipri
Dec 17, 2022
Iain Buclaw
September 18, 2021
https://issues.dlang.org/show_bug.cgi?id=22002

--- Comment #1 from mipri <mipri@minimaltype.com> ---
workaround:

auto noapply(T)(T x) {
    import std.range.primitives : ElementType;

    struct NoApply(T) {
        T wrapped;
        alias wrapped this;
        @disable ElementType!T opApply();
    }
    return NoApply!T(x);
}

unittest {
    import std.algorithm : each;
    import std.range : only, inputRangeObject;
    import std.stdio : writeln;

    only(1, 2).inputRangeObject.noapply.each!writeln;
}

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=22002

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
December 13
https://issues.dlang.org/show_bug.cgi?id=22002

--- Comment #2 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/19940

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--