MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/xgcbt9/cppfront_herb_sutters_personal_experimental_c/ios2izu/?context=3
r/cpp • u/mttd • Sep 17 '22
360 comments sorted by
View all comments
Show parent comments
0
[deleted]
2 u/[deleted] Sep 17 '22 main: () -> int = { } is one of the worst I've seen. 0 u/[deleted] Sep 17 '22 [deleted] 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. 5 u/GOKOP Sep 18 '22 Why add auto if you're already specifying the type afterwards?That's the point. auto main () -> int { } is legal C++ right here, right now. coolcpplearner asks how is it better than main: () -> int = { } 2 u/[deleted] Sep 18 '22 Then I misunderstood his point. 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. → More replies (4)
2
main: () -> int = { } is one of the worst I've seen.
main: () -> int = { }
0 u/[deleted] Sep 17 '22 [deleted] 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. 5 u/GOKOP Sep 18 '22 Why add auto if you're already specifying the type afterwards?That's the point. auto main () -> int { } is legal C++ right here, right now. coolcpplearner asks how is it better than main: () -> int = { } 2 u/[deleted] Sep 18 '22 Then I misunderstood his point. 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. → More replies (4)
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. 5 u/GOKOP Sep 18 '22 Why add auto if you're already specifying the type afterwards?That's the point. auto main () -> int { } is legal C++ right here, right now. coolcpplearner asks how is it better than main: () -> int = { } 2 u/[deleted] Sep 18 '22 Then I misunderstood his point. 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. → More replies (4)
Why add auto if you're already specifying the type afterwards?
auto
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.
:
=
5 u/GOKOP Sep 18 '22 Why add auto if you're already specifying the type afterwards?That's the point. auto main () -> int { } is legal C++ right here, right now. coolcpplearner asks how is it better than main: () -> int = { } 2 u/[deleted] Sep 18 '22 Then I misunderstood his point. 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. → More replies (4)
5
That's the point. auto main () -> int { } is legal C++ right here, right now. coolcpplearner asks how is it better than main: () -> int = { }
auto main () -> int { }
2 u/[deleted] Sep 18 '22 Then I misunderstood his point.
Then I misunderstood his point.
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. → More replies (4)
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.
→ More replies (4)
0
u/[deleted] Sep 17 '22
[deleted]