D const design rationale
Daniel Keep
daniel.keep.lists at gmail.com
Fri Jun 22 09:11:48 PDT 2007
Sean Kelly wrote:
> Daniel Keep wrote:
>>
>> Frits van Bommel wrote:
>>> Allowing it allows cleaner generic code, otherwise templates would often
>>> have to check whether parameters were value or reference types.
>>
>> Indeed; we already need to special-case functions that return void.
>
> How so? I thought "return void" was a legal statement?
>
> Sean
Indeed it is. But what if you need to actually *store* the return value?
I believe the problems I had with the coroutine stuff specifically were
storing the return value and having functions that passed *in* a value
of the return type (which obviously had to be written separately for
functions with void since you can't have void parameters, either).
-- Daniel
More information about the Digitalmars-d
mailing list