I want to create a std::vector<char>
with something like: v(map.begin(), map.end());
rather than iterating over all elements of the map and resizing v
over and over.
#include<iostream>
#include<map>
#include<vector>
int main() {
std::map<int, char> map{{1,'a'},{2,'b'},{3,'c'}, {4,'d'}};
std::vector<char> v;
for(auto& [ i , c ] : map){
// std::cout << i << " -> " << c <<"\n";
v.push_back(c);
}
}