// C++ program to demonstrate the
// working of vector of vectors
// of pairs
#include <bits/stdc++.h>
using namespace std;
// Function to print 2D vector elements
void print(vector<vector<pair<char,
bool>>> &myContainer)
{
// Iterating over 2D vector elements
for(auto currentVector: myContainer)
{
// Each element of the 2D vector is
// a vector itself
vector<pair<char, bool>> myVector =
currentVector;
// Iterating over the vector
// elements
cout << "[ ";
for(auto pr: myVector)
{
// Print the element
cout << "{";
cout << pr.first << " , " <<
pr.second;
cout << "} ";
}
cout << "]\n";
}
}
// Driver code
int main()
{
// Declaring a 2D vector of pairs
// Pairs are of type {char, bool}
vector<vector<pair<char, bool>>> myContainer;
// Initializing vectors of pairs
vector<pair<char, bool>> vect1 =
{{'G', 0}, {'e', 0},
{'e', 0}, {'k', 0}};
vector<pair<char, bool>> vect2 =
{{'G', 1}, {'e', 1},
{'e', 1}, {'k', 1}};
vector<pair<char, bool>> vect3 =
{{'G', 0}, {'e', 0},
{'e', 0}, {'k', 1}};
vector<pair<char, bool>> vect4 =
{{'G', 0}, {'e', 1},
{'e', 0}, {'k', 1}};
// Inserting vectors in the 2D vector
myContainer.push_back(vect1);
myContainer.push_back(vect2);
myContainer.push_back(vect3);
myContainer.push_back(vect4);
print(myContainer);
return 0;
}