Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
making assumeSafeAppend return a value.
Browse files Browse the repository at this point in the history
  • Loading branch information
monarchdodra committed Jul 8, 2013
1 parent a69742f commit 0e41c43
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/object_.d
Expand Up @@ -2602,9 +2602,15 @@ unittest
* Calling this function, and then using references to data located after the
* given array results in undefined behavior.
*/
void assumeSafeAppend(T)(T[] arr)
ref T[] assumeSafeAppend(T)(ref T[] arr)
{
_d_arrayshrinkfit(typeid(T[]), *(cast(void[]*)&arr));
return arr;
}
/// ditto
T[] assumeSafeAppend(T)(T[] arr)
{
return assumeSafeAppend(arr);
}
///
unittest
Expand Down

0 comments on commit 0e41c43

Please sign in to comment.