00 // 01 // Demonstrates structured bindings 02 // 03 04 #include <map> 05 #include <string> 06 #include <iostream> 07 08 void InsertNickname(std::map<std::string, std::string>& db, 09 const std::string& nickname, const std::string& realname) 10 { 11 if (const auto& [it, inserted] = db.emplace(nickname, realname); inserted) 12 std::cout << "Congratualtions your nickname is original!\n"; 13 else 14 { 15 auto& [key, value] = *it; 16 std::cout << value << " has this nickname already...\n"; 17 } 18 } 19