Having defined my objects myType, I need to store relations between these objects. These relations are stored on a matrix.
The number of elements is not
You could use a boost::unordered_map with key std::pair in combine with boost::hash. You could declare it as:
boost::unordered_map,
std::vector>,
boost::hash>> dictionary;
Then you could load the characteristics of each pair in the dictionary like in the example below:
dictionary[std::make_pair(&a, &b)] = std::vector>(1, {1, 2, 3, 4, 5});
And access them as:
dictionary[std::make_pair(&a, &b)][0][0];
LIVE DEMO