Date: Tue, 22 Jul 2025 20:31:23 +0200
> On 22 Jul 2025, at 19:50, Jan Schultke via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
>> the bang for the buck isn't there, and this sort of small tweaks to
>> const-correctness of argv and the return type of main are not a good
>> use of the committee time.
>
> How would you feel about it if the proposal also included
> standardization of a third "char** envp" parameter, which every
> implementation already supports?
>
> Would that sufficiently broaden the scope of the proposal to be worth
> committee time?
It might admit signatures of the form
int main(std::vector<std::string> arg, std::unordered_map<std::string, std::string> env);
where std::string might be replaced by std::string_view, and std::unordered_map by std::map, easily implemented from
int main(int argc, char *argv[], char* envp[]);
I am using it, but I found std::string_view not useful because of the lack of conversions to std::string.
>
>> the bang for the buck isn't there, and this sort of small tweaks to
>> const-correctness of argv and the return type of main are not a good
>> use of the committee time.
>
> How would you feel about it if the proposal also included
> standardization of a third "char** envp" parameter, which every
> implementation already supports?
>
> Would that sufficiently broaden the scope of the proposal to be worth
> committee time?
It might admit signatures of the form
int main(std::vector<std::string> arg, std::unordered_map<std::string, std::string> env);
where std::string might be replaced by std::string_view, and std::unordered_map by std::map, easily implemented from
int main(int argc, char *argv[], char* envp[]);
I am using it, but I found std::string_view not useful because of the lack of conversions to std::string.
Received on 2025-07-22 18:31:42