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 comments

0

u/[deleted] Sep 17 '22

Why add auto if you're already specifying the type afterwards?

And my issue with the original were the added : and =; they were redundant.
The = could be used in lambdas only, it would make it pretty clear.

0

u/[deleted] Sep 17 '22

[deleted]

2

u/[deleted] Sep 18 '22 edited Sep 18 '22

Afaik, the arrow at the end already eliminates confusion between declaration and call (unless I'm forgetting other uses for it).

I think the = should be used only with lambdas, that would look pretty good.

1

u/AIlchinger Sep 18 '22

That's right. However, the parser works left to right and the easier it can distinguish between call or declaration, the more efficient it can (potentially) be.

→ More replies (3)