Auto function without return statement, prefer an explicit void

Anonymouse zorael at gmail.com
Thu May 19 09:15:50 UTC 2022


I like explicit return types. But I also like inference.

```d
struct SomeContainer(T)
{
/* ... */
     auto clear()
     {
         head = 0;
         tail = 0;
         buf[] = T.init;
     }
}
```

dscanner -S: `Auto function without return statement, prefer an 
explicit void`

Can we please have `void clear() auto`?


More information about the Digitalmars-d mailing list