On Tuesday, 18 July 2017 at 21:45:27 UTC, Adam D. Ruppe wrote:
On Tuesday, 18 July 2017 at 21:35:21 UTC, Moritz Maxeiner wrote:Could you explain why `return foo();` is even legal for a `void foo() {}`?Suppose you are writing a template function that forwards: auto forward(alias fun, T...)(T args) { return fun(args); } It just saves you from having to static if(fun returns void).
That's a good pragmatic (syntactic sugar) reason, thanks.