How to copy keys from map to vector. Specifically I have a map<int, int>
and I want keys
of the map to form a new vector (vector<int>
).
So a map (<1,100>; <2,99>)
should give a vector of (1,2)
.
Question here, describes exactly what I need but for values, but the response is too cryptic to understand. I cannot understand how the unary operator function is written. Can somebody explain how it is written?