I would like to initialize a vector of pair<char, int>
in one line using STL.
From what I have found the following works but can only initialize every element with the same value.
vector<pair<char, int>> myVec (26, std::make_pair('a', -1));
Is there a way to initialize it, maybe with a lamda function or something, so that the char elements will be incremental like:
(a,-1) (b,-1) (c,-1) etc...
and all this in one line without using a classic loop after initialization? Thanks in advance.