[Issue 12736] @nogc std.algorithm.all

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jul 12 10:39:07 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=12736

Jon Degenhardt <jrdemail2000-dlang at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jrdemail2000-dlang at yahoo.co
                   |                            |m

--- Comment #2 from Jon Degenhardt <jrdemail2000-dlang at yahoo.com> ---
Seems a legitimate enhancement request, and in line with the longer term goal
of having Phobos be @nogc when possible. In this particular case, there doesn't
appear to be any reason why the functionality implemented by std.algorithm.all
cannot be @nogc. And, std.algorithm.find could be @nogc as well in this case.

Personally though, I would hesitate to write an enhancement request against
each individual function in Phobos for every attribute, and instead have a
larger placeholder ticket for larger blocks of Phobos, for example, a ticket
for all of std.algorithm. The above is a policy question of course, but if done
this way then this ticket could be closed as a duplicate of the larger ticket,
rather than closing it as invalid.

As aside: std.algorithm.find is @nogc for certain argument types. Example:

@nogc @safe nothrow pure unittest
{
    import std.algorithm : find;
    import std.range : iota;

    assert(find(iota(1,5), 3) == iota(3,5));
}

--


More information about the Digitalmars-d-bugs mailing list