C++ Logo

std-proposals

Advanced search

Re: [std-proposals] A draft for a std::arguments proposal

From: Tiago Freire <tmiguelf_at_[hidden]>
Date: Wed, 16 Oct 2024 05:34:34 +0000
> A copy of what? You didn't provide a way to create a std::arguments or arguments_view from existing a string array in your paper. That would still be sub-optimal, because we'd have to document:
> "Do not EVER use std:arguments(). Instead, use QCoreApplication::arguments_view(), which has the same interface but is correct."
(becausw QCoreApplication::arguments() is already taken)

Well, its not my paper.
It is a view, so you can make a copy of the view, and do whatever you want with it.
"GetCommandLineW" isn't modifiable, nor would "/proc/self/cmdline", but that never was a deal breaker. I think you are missing the point.

And it is not like this is deprecating stuff that exist, everything that works right now will still work.
And if std::arguments were to be just a view, wouldn't its interface be const, and wouldn't that stop you from using it in Qt's API which expects it to be not const?
And it is not like modifying argv from main is a particularly well-defined thing either.

You can make the argument that it is a feature that it is not for you, but then again, the same is true for more than half of the things in the standard.
But that doesn't mean it is bad or that it is not good enough to make it to the standard.


-----Original Message-----
From: Std-Proposals <std-proposals-bounces_at_lists.isocpp.org> On Behalf Of Thiago Macieira via Std-Proposals
Sent: Wednesday, October 16, 2024 6:55 AM
To: std-proposals_at_[hidden]
Cc: Thiago Macieira <thiago_at_macieira.org>
Subject: Re: [std-proposals] A draft for a std::arguments proposal

On Tuesday 15 October 2024 21:41:56 GMT-7 Tiago Freire wrote:
> > Well, then the rest of my email applies: what's the path toward
> > making it modifiable?
> Is there anything stopping you from making a copy?

A copy of what? You didn't provide a way to create a std::arguments or arguments_view from existing a string array in your paper. That would still be sub-optimal, because we'd have to document:

"Do not EVER use std:arguments(). Instead, use QCoreApplication::arguments_view(), which has the same interface but is correct."
(becausw QCoreApplication::arguments() is already taken)

--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Platform & System Engineering



--
Std-Proposals mailing list
Std-Proposals_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2024-10-16 05:34:41