struct A(T) { T t; } A!(inout(int)) not_working(inout(int)); // Error: variable `example.A!(inout(int)).A.t` only parameters or stack based variables can be `inout` --- dmd 2.094.2 --- https://dlang.org/spec/function.html#inout-functions
That's by design. *** This issue has been marked as a duplicate of issue 9983 ***
Also issue 15651.