proposed @noreturn attribute

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 18 14:45:27 PDT 2017


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).


More information about the Digitalmars-d mailing list