On 7/2/2017 2:34 AM, ag0aep6g wrote:
On 07/02/2017 10:55 AM, Walter Bright wrote:
If it is declared as:
inout(char)[] foo(bool condition, inout(char)[] chars);
your specific case will work as expected. Perhaps you meant:
No, it doesn't. The function doesn't compile with that signature.
----
inout(char)[] foo(bool condition, inout(char)[] chars)
{
if (!condition)
return "condition failed!"; /* Error: cannot implicitly convert
expression "condition failed!" of type string to inout(char)[] */
return chars;
}
----
You're right.