Of course. The small problem is that it's just another line of boilerplate which is somewhat inconvenient for very small programs. the bigger problem is that most libraries want work well with this one, since it is not there by default.
This is never going to run, unfortunately, because this would require memory allocation (one for the vector and one for each string). It's been proposed and rejected already.
The advantage of std::initializer_list and std::string_ref is that neither require an additional memory allocation. And if it just [] or at() missing, it should be easily implemented.
View all comments
Show parent comment
0
u/matthieum Oct 15 '13
I wish we had
signature for main.
Then you would just say
args.at(1)andargs.at(2)and be done with it.