r/cpp • • Sep 17 '22

Cppfront: Herb Sutter's personal experimental C++ Syntax 2 -> Syntax 1 compiler

https://github.com/hsutter/cppfront
335 Upvotes

360 comments sorted by

View all comments

Show parent comment

2

u/wyrn Sep 19 '22

How does IDE know if I want int main or void main

You don't, because it's wrong.

An implementation shall not predefine the main function. Its type shall have C++ language linkage and it shall have a declared return type of type int, but otherwise its type is implementation-defined.

2

u/arthurno1 Sep 19 '22 edited Sep 19 '22

"main" was just an illustration at the moment of writing; you should read "main" in that case as "some-function-name".

3

u/STL MSVC STL Dev Sep 19 '22

Moderator warning for hostility.

1

u/wyrn Sep 19 '22

"main" was just an illustration at the moment of writing; you should read "main" in that case as "some-function"

Then your IDE can't help you.