return the other functions of the void main()

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 9 04:22:08 PDT 2015


On Thursday, 9 April 2015 at 11:07:05 UTC, Rikki Cattermole wrote:
> On 9/04/2015 11:03 p.m., Dennis Ritchie wrote:
>> Hi,
>> Is it allowed in D similar designs?
>>
>> void main() {
>>     import std.stdio;
>>     return writeln("Hello, world!");
>> }
>
> Sure when:
>
> import std.traits : ReturnType;
> import std.stdio : writeln;
>
> static assert(is(ReturnType!writeln == int));

You might wanna check that :p


More information about the Digitalmars-d-learn mailing list