I want to make a line like this hello my name sounds very fancy
from a vector of these words (std::vector<std::string> myvector = {"hello", "my", "name", "sounds", "very", "fancy"}
).
What is the most efficient way to perform such convertion without inserting redundant spaces, as would happen if I used
for (auto element : v) {
std::cout << word_from_vector << ' ';
}
?