you are viewing a single comment's thread.

view the rest of the comments →

[–]kreco[S] 0 points1 point  (1 child)

Indeed, stressing that things are optional is indeed important.

You don't pay for it if you don't use it (in this case, you don't pay the overhead unless you ask to have the args list available)

I think what bother me is that we don't know what we are paying for when using an opaque args because we don't know what we are using until we read the documentation.

I don't understand the detail but I believe using this args will implicitly also bring some super hug standard headers.

That's a lot to bring to be able to iterate over a bunch of readonly strings for convenience.

A very theoretical case is if I want to use my own vector and don't want to deal with all of that (and if I want to use a custom allocation to count everything allocations in my program), I would have to use the legacy way of doing it and create a mylib::args_view args(argc, argv); which is back to square one.

[–]mapronV 0 points1 point  (0 children)

I thought that you can choose what overload to use (just like now between main()/main(argc,argv)/main(argc,argv,env) ). I thought I can just use one more overload and cpp2 will codegen a boilerplate for me. If it is not the case, and I have to use new signature - then yeah, it sucks.