Is it possible to initialize vector<char> from a string in a single line of code?
I do this:
vector<char> vec; string str = "To travel you need a wish and your passport"; for (auto it : str) { vec.push_back(it); } But I would like to know a more elegant way.