From ad32f1c76ae04afdfbcd389d9b8f45f6357afb5f Mon Sep 17 00:00:00 2001 From: "alexis.drai" Date: Wed, 1 Feb 2023 15:01:07 +0100 Subject: [PATCH] :construction: Multimap stuff --- main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main.cpp b/main.cpp index 5361a04..bd11997 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "Personnage/Personnage.h" #include "Personnage/Kenny.h" @@ -143,6 +144,17 @@ int main() (*p)->parler("hey"); } + multimap mm; + for (auto character: anime) + { + mm.insert({character->name(), character}); + } + + if (auto found = mm.find("Eric"); found != mm.end()) + { + found->second->parler("wazaaaaaa'"); + } + for (auto character: anime) delete character; return 0;