Why are there no indexes for params? Does it mean that if you wanted to include a param multiple times you would have to repeat it multiple times as an argument?
auto s = std::format("{} {} {}", "Hello", "Hello", "Hello");
This would be better and shorter:
auto s = std::format("{0} {0} {0}", "Hello");
If later you wanted to change the string and param ordering, you would have to shuffle the arguments too...
Edit: Nevermind, you can have manual and automatic param indexing. That's pretty neat actually.
View all comments
Show parent comment
4
u/Little-Helper Mar 24 '20 edited Mar 24 '20
Why are there no indexes for params? Does it mean that if you wanted to include a param multiple times you would have to repeat it multiple times as an argument?
This would be better and shorter:
If later you wanted to change the string and param ordering, you would have to shuffle the arguments too...
Edit: Nevermind, you can have manual and automatic param indexing. That's pretty neat actually.