'is(T==return)' How does is expression with return keyword as TypeSpecialization

Alex sascha.orlov at gmail.com
Thu Jul 5 11:53:07 UTC 2018


On Thursday, 5 July 2018 at 11:37:16 UTC, Timoses wrote:
>
> I think it refers to this section:
> https://dlang.org/spec/expression.html#is_expression
>
> I don't remember where I read this usage (think it was in a 
> book), but I noted it down and now I wonder how it can be used.

I saw some usage cases, which are like "opposites" to auto fun() 
declarations:
So either you can declare

´´´
auto fun()
{
     int retVal;
     ...
     return retVal;
}
´´´

or


´´´
int fun()
{
     typeof(return) retVal;
     ...
     return retVal;
}
´´´


More information about the Digitalmars-d-learn mailing list