queue of vector insert

how to insert value to
queue<vector<pair<int,int>,int>> q;

I tried q.push({1,2},3) but getting error.
queue<vector<pair<int,int>,int>> q;
The premise of your question doesn't make sense.

Starting from the inside-out, we have a pair<int,int>. Let's call that P:
queue< vector<P,int> > q;

What does it mean to have a vector<X, Y>? A vector's template only takes in one type.

My guess at what you meant:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Example program
#include <iostream>
#include <queue>
#include <vector>
#include <utility>

int main()
{
    using std::vector;
    using std::queue;
    using std::pair;
    
    queue<pair<vector<int>, int>> q;

    q.push( { {1, 2}, 3} );

}
Last edited on
Topic archived. No new replies allowed.