@noreturn property
Stewart Gordon
smjg_1998 at yahoo.com
Fri Oct 22 10:22:19 PDT 2010
On 22/10/2010 03:44, Rainer Deyke wrote:
<snip>
> A 'void' function returns, therefore it conceptually returns a value.
> For generic programming, it is useful to treat 'void' as a type like any
> other, except that it only has one possible value (and therefore encodes
> no information and requires no storage). If this is not implemented in
> D at the moment, it should be.
I've sometimes thought about this, and felt in any case that void.sizeof
ought to be 0.
The problem now is that it would clash with void array slicing and
pointer arithmetic, which rely on the size of void being 1.
Stewart.
More information about the Digitalmars-d
mailing list