Skip to content

Commit

Permalink
Add inout to std.range.front to reduce template proliferation
Browse files Browse the repository at this point in the history
The Win32_64 linker error that prevented this from being included in
PR #6743 no longer occurs in CI.
  • Loading branch information
n8sh committed Jun 6, 2019
1 parent c5664d4 commit e5bae1d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions std/range/primitives.d
Original file line number Diff line number Diff line change
Expand Up @@ -2419,15 +2419,8 @@ equivalent to `front(array)`. For $(GLOSSARY narrow strings), $(D
front) automatically returns the first $(GLOSSARY code point) as _a $(D
dchar).
*/
@property ref T front(T)(return scope T[] a) @safe pure nothrow @nogc
@property ref inout(T) front(T)(return scope inout(T)[] a) @safe pure nothrow @nogc
if (!(autodecodeStrings && isNarrowString!(T[])) && !is(T[] == void[]))
// We would have preferred to write the function template
// ---
// @property ref inout(T) front(T)(return scope inout(T)[] a)
// if (/* same constraint */)
// ---
// as that would cause fewer distinct functions to be generated with
// IFTI, but that caused a linker error in the test suite on Win32_64.
{
assert(a.length, "Attempting to fetch the front of an empty array of " ~ T.stringof);
return a[0];
Expand Down

0 comments on commit e5bae1d

Please sign in to comment.