Unexpectedly nice case of auto return type

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Dec 3 21:31:20 UTC 2019

On Tue, Dec 03, 2019 at 09:08:55PM +0000, Paul Backus via Digitalmars-d-learn wrote:
> On Tuesday, 3 December 2019 at 17:45:27 UTC, H. S. Teoh wrote:
> > The thing is, `void` means "no return type" (or "no type" in some
> > contexts), i.e., void == TBottom in that case.
> This is incorrect. `void` as a return type is a unit type; that is, a
> type with exactly one value. A function with a return type of TBottom
> is one that never returns at all--for example, libc's `exit` or
> POSIX's `execve`.

Ah, my bad.  See?  This whole `void` business just throws me off. No
wonder we can never get things straight when it comes to top/bottom
types in C/C++/D.


He who sacrifices functionality for ease of use, loses both and deserves neither. -- Slashdotter

More information about the Digitalmars-d-learn mailing list