I want to create an adjacency matrix for a graph. Since I read it is not safe to use arrays of the form matrix[x][y] because they don\'t check for range, I deci
Probably, not relevant as this is an old question, but you can use the Armadillo library, which provides many linear algebra oriented data types and functions.
Below is an example for your specific problem:
// In C++11
Mat matrix = {
{ true, true},
{ false, false},
};
// In C++98
Mat matrix;
matrix << true << true << endr
<< false << false << endr;