Date: Wed, 23 Jul 2025 15:38:26 +0200
We went through using C++ types in the recent past on this mailing list.
Points for discussion were:
- Possibly high overhead for long command lines - either time or space overhead.
- IIRC some platforms allow to modify the parameters or environment variables, which is actively used by some frameworks. Would this be supported by the C++ types?
-----Ursprüngliche Nachricht-----
Von:Hans Åberg via Std-Proposals <std-proposals_at_[hidden]>
Gesendet:Mi 23.07.2025 14:49
Betreff:Re: [std-proposals] D3803R0 More standard forms of main
An:std-proposals_at_[hidden];
CC:Hans Åberg <haberg_1_at_[hidden]>;
The prototype should probably be
int main(const std::vector<std::string>& arg, const std::map<std::string, std::string>& env);
so that one gets the environmental variables sorted (ordering is not specified on POSIX). (There is a lot of overhead with std::unordered_map for small tables.)
I also see the primary reason for including it is that one can program with C++ types, which are more secure. And one does not need to worry about what exactly the OS is doing.
Received on 2025-07-23 13:48:14