How can I use the push_back
function in a structure?
I have the Arc structure:
struct Arco {
int i, j;
Arco () {};
Arco (const Arco& obj): i(obj.i), j(obj.j) {};
Arco(int _i, int _j) : i(_i), j(_j) {}
};
And so I have a vector of arcs vectors:
vector < vector < Arco > > Df;
Df = vector < vector < Arco > >(nn, vector < Arco > ( ) );
I would like to be able to fill Df like this:
Df[i][j].push_back(Arco(u,v));
How do I enable this command?