Feature Request: make void a value type

downs default_357-line at yahoo.de
Mon Dec 3 09:10:47 PST 2007


Jarrett Billingsley wrote:
> "downs" <default_357-line at yahoo.de> wrote in message 
> news:fj1cc2$13c3$1 at digitalmars.com...
>> Proposal: to allow us to treat void as a value type.
>> What this would allow:
>> * simplifying templates that differ between return type, i.e. static if 
>> (is(ReturnType!(C)==void)) param(); else return param();
> 
> This is already possible.  Return statements with expressions in functions 
> that return void will be evaluated and their results thrown away.
> 
[snip example]

Yes, but what I want is actually being able to _return an expression that *evaluates to void*_. Not the same.
 --downs



More information about the Digitalmars-d mailing list