jeudi 22 juin 2023

dictionary with pair/index?

Which structure is more suited in C++ (11) for store object accessing to them using a pair index?

Tried somethings like this:

typedef std::map<std::pair<int, int>, MyObject> MyDictionaryPairIndexes;

using:

std::pair<int, int>

as pair index, but

  1. not sure how to access to it later using a pair index (at() what?)
  2. if that's the correct way

Any example?

Aucun commentaire:

Enregistrer un commentaire