Thread overview
[Issue 12666] @nogc std.array.front, popFront, and more
May 12, 2014
yebblies
Apr 23, 2015
ag0aep6g@gmail.com
Apr 23, 2015
ag0aep6g@gmail.com
Apr 24, 2015
ag0aep6g@gmail.com
April 27, 2014
https://issues.dlang.org/show_bug.cgi?id=12666

--- Comment #1 from bearophile_hugs@eml.cc ---
(In reply to bearophile_hugs from comment #0)

>     enum msg = "Attempting to fetch the front of an empty array of " ~
> T.stringof;
>     assert(a.length, msg);

A little shorter code, that requires less changes:

assert(a.length, ctEval!("Attempting to fetch the front of an empty array of "
~ T.stringof));

Where ctEval is a very small construct that should be added to Phobos that forces the evaluation of an expression at compile-time.

--
May 12, 2014
https://issues.dlang.org/show_bug.cgi?id=12666

yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies@gmail.com

--- Comment #2 from yebblies <yebblies@gmail.com> ---
I suspect the error message is already being computed statically thanks to constfolding, it just happens after @nogc inference has been run.

--
April 23, 2015
https://issues.dlang.org/show_bug.cgi?id=12666

ag0aep6g@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ag0aep6g@gmail.com
           Hardware|x86                         |All
                 OS|Windows                     |All

--- Comment #3 from ag0aep6g@gmail.com ---
Apparently, the underlying dmd issue has been fixed/implemented. A pull request to add @nogc to the various functions: https://github.com/D-Programming-Language/phobos/pull/3219

--
April 23, 2015
https://issues.dlang.org/show_bug.cgi?id=12666

ag0aep6g@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--
April 24, 2015
https://issues.dlang.org/show_bug.cgi?id=12666

--- Comment #4 from github-bugzilla@puremagic.com ---
Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/0842fc7841b9c3db558681717c2d8b4da1479ce6 @nogc for std.range.primitives.{empty,save,popFront,popBack,front,back}

Excluding the UTF-decoding variants, because those throw GC allocated exceptions.

Makes sure that issue 12666 - "@nogc std.array.front, popFront, and more" stays fixed.

--
April 24, 2015
https://issues.dlang.org/show_bug.cgi?id=12666

ag0aep6g@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
July 19, 2017
https://issues.dlang.org/show_bug.cgi?id=12666

--- Comment #5 from github-bugzilla@puremagic.com ---
Commit pushed to dmd-cxx at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/0842fc7841b9c3db558681717c2d8b4da1479ce6 @nogc for std.range.primitives.{empty,save,popFront,popBack,front,back}

--