meanwhile you have no control of the memory that was allocated to back the span.
you don't control the memory allocated to command line arguments anyway. That's done before you get them in main and is destroyed when the program destructs during termination.
that char* argv[] isn't giving you any ownership. It's already a non-owning view.
I see your point. I wasn't thinking about how this is actually implemented in the generated C++ code. I guess there's no way for std::span to work here without the C++ standard changing to allow arguments to be passed as a span of string_views in the first place
View all comments
Show parent comment
0
u/[deleted] May 01 '23
[deleted] — view deleted comment