#include #include #include #include using namespace std; int main() { list a = {"janez", "miha", "marko"}; map::iterator> mesto; auto it = a.begin(); while (it != a.end()) { mesto[*it] = it; ++it; } for (const string& s : a) cout << s << ' '; cout << endl; string clovek1 = "janez"; string clovek2 = "marko"; auto j1 = mesto[clovek1]; auto j2 = mesto[clovek2]; a.erase(j1); auto n = a.insert(j2, clovek1); mesto[clovek1] = n; for (const string& s : a) cout << s << ' '; cout << endl; for (const auto& p : mesto) { cout << p.first << " -> " << *p.second << endl; } return 0; }