Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/core/internal/array/appending.d
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ template _d_arrayappendTImpl(Tarr : T[], T)

private enum errorMessage = "Cannot append to array if compiling without support for runtime type information!";

ref Tarr _d_arrayappendTImpure(return scope ref Tarr x, scope Tarr y)
{
pragma(inline, false);

mixin(_d_arrayappendTBody);
}

/**
* Append array `y` to array `x`.
* Params:
Expand All @@ -98,16 +105,14 @@ template _d_arrayappendTImpl(Tarr : T[], T)
static if (isCopyingNothrow!T)
ref Tarr _d_arrayappendT(return scope ref Tarr x, scope Tarr y) @trusted pure nothrow
{
pragma(inline, false);

mixin(_d_arrayappendTBody);
alias Type = ref Tarr function(return scope ref Tarr x, scope Tarr y) pure nothrow;
return (cast(Type) &_d_arrayappendTImpure)(x, y);
}
else
ref Tarr _d_arrayappendT(return scope ref Tarr x, scope Tarr y) @trusted pure
{
pragma(inline, false);

mixin(_d_arrayappendTBody);
alias Type = ref Tarr function(return scope ref Tarr x, scope Tarr y) pure;
return (cast(Type) &_d_arrayappendTImpure)(x, y);
}

private enum _d_arrayappendTBody = q{
Expand Down