January 04, 2016
Can someone produce a _useful_ free function that uses inout?

There are useful getters using inout.
There are useless free functions using inout like http://dpaste.dzfl.pl/d038012308ed


January 04, 2016
On Monday, 4 January 2016 at 23:15:22 UTC, Guillaume Piolat wrote:
> Can someone produce a _useful_ free function that uses inout?
>
> There are useful getters using inout.
> There are useless free functions using inout like http://dpaste.dzfl.pl/d038012308ed

Adam D. Ruppe answered this on IRC:

inout(char)[] chomp(inout(char)[] str)
{
    return if(str.length && str[$-1] == '\n') str[0 .. $-1] : str;
}