Find out all the previously discussed proposals to this topic and why they were not successful so far.
Here are some links:
https://www.reddit.com/r/cpp/comments/hikpil/proposal_new_way_of_defining_main_for_c23/
-----Ursprüngliche Nachricht-----
Von: Jeremy Rifkin via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Sa 07.09.2024 17:37
Betreff: [std-proposals] Floating an idea: int main(std::span<std::string_view> args)
An: std-proposals@lists.isocpp.org;
CC: Jeremy Rifkin <jeremy@rifkin.dev>;
Hello,
I'd like to propose adding int main(std::span<std::string_view> args) as
a standard signature for main.
Motivation:
- Modernization
- Ergonomics
- Teachability
- Modern C++ through and through instead of 'what's a char**' and
'argv[1] == "--help" is a footgun, beware'
Considerations:
- There would be slight startup overhead in constructing the
std::string_views and underlying array of string views, however, this
would be entirely opt-in
- It would probably add some implementation complexity
- This would be an aspect of the core language which depends on the
standard library. I don't love that, but, there is precedence for this
sort of thing
- Direct mutability of the argument contents would be lost
I would make a reference implementation as part of the proposal.
Cheers,
Jeremy
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals