How to get return type of current method?
Meta via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Apr 18 18:40:19 PDT 2017
On Wednesday, 19 April 2017 at 00:22:14 UTC, Mike B Johnson wrote:
> On Tuesday, 18 April 2017 at 23:49:35 UTC, ketmar wrote:
>> Mike B Johnson wrote:
>>
>>> How can I get the return type of the current method without
>>> specifying the name or any complexity? Similar to
>>> typeof(this).
>>
>> typeof(return)
>
> Thanks, sweet and simple!
One note: if the function has a return type of `auto`, you cannot
use `typeof(return)` within the function.
More information about the Digitalmars-d-learn
mailing list