It should work for g++, as long as you build you own "std" module (which sadly is
somewhat complicated) and enables -fmodule-ts. I guess he's hoping that will be easier in 2023.
What bothers me more is the lack of "return 0"
What bothers me more is the lack of "return 0"
A return statement in main has the effect of leaving the main function (destroying any objects with automatic storage duration) and calling std::exit with the return value as the argument. If control reaches the end of main without encountering a return statement, the effect is that of executing
return 0;
>5.1.2.2.3 Program termination [...] reaching the } that terminates the main function returns a value of 0.
And I just looked it up for C. Since C99, if the return type of `main` is `int` and there is no explicit return (or again you fall through to the end without hitting one) there's an implicit `return 0`. Before C99, undefined.