This is what I am aiming to do...
vector < pair<vector<int>,int> > var_name (x, pair <vector<int>(y),int>);
Where x is the size of the vector var_name and y is the size of the vector inside the pair.
The above statement doesn't work because the pair template only allows constants. How can I go about getting both my vectors to size to x and y respectively?
vector<pair<vector<int>,int> > var_name(x, make_pair(vector<int>(y), 0));
Simplify it as:
pair<vector<int>,int> value(vector<int>(y), 0);
vector<pair<vector<int>,int> > var_name(x, value);
If you like your own syntax, then you should be doing this:
vector<pair<vector<int>,int> > var_name(x, std::make_pair(vector<int>(y), 0));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With