Functions that return type

rsw0x via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jan 16 14:09:17 PST 2016


On Saturday, 16 January 2016 at 21:22:15 UTC, data pulverizer 
wrote:
> Is it possible to create a function that returns Type like 
> typeof() does? Something such as:
>
> Type returnInt(){
>     return int;
> }

Functions return values, not types. You would use a template to 
"return" a type.

>
> More to the point what is the Type of a type such as int?
>
> Thanks

What is the value of a value such as 9? A type is a type, it does 
not have a type.

If this is not clear, I can try to make it clearer.


More information about the Digitalmars-d-learn mailing list