revert incorrect change

This commit is contained in:
greg7mdp
2022-07-22 17:14:02 -04:00
parent 8650bcc503
commit 25a6a5024d
Executable → Regular
+19 -32
View File
@@ -1,41 +1,28 @@
#include <vector>
#include <string>
#include <iostream>
#include "parallel_hashmap/phmap.h"
#include <string>
#include <parallel_hashmap/phmap.h>
using phmap::flat_hash_map;
int main() {
phmap::flat_hash_map<std::string, std::vector<std::string>> mymap;
int main()
{
// Create an unordered_map of three strings (that map to strings)
flat_hash_map<std::string, std::string> email =
{
{ "tom", "tom@gmail.com"},
{ "jeff", "jk@gmail.com"},
{ "jim", "jimg@microsoft.com"}
};
//initialize mymap
mymap["hitF"].push_back("hitF");
mymap["hitB"].push_back("hitB");
mymap["idleF"].push_back("idleF");
mymap["idleB"].push_back("idleB");
mymap["walkF"].push_back("walkF");
mymap["walkB"].push_back("walkB");
mymap["dyingF"].push_back("dyingF");
mymap["dyingB"].push_back("dyingB");
mymap["attackF"].push_back("attackF");
mymap["attackB"].push_back("attackB");
// Iterate and print keys and values
for (const auto& n : email)
std::cout << n.first << "'s email is: " << n.second << "\n";
//set fallbacks
mymap["downB"] = mymap["idleB"];
mymap["downF"] = mymap["idleF"];
mymap["hit_upF"] = mymap["idleF"];
mymap["hit_upB"] = mymap["idleB"];
mymap["weakF"] = mymap["idleF"];
mymap["weakB"] = mymap["idleB"];
//print map
for(auto& element : mymap) {
std::cout << element.first << ": ";
for(auto& inner : element.second) {
std::cout << inner;
}
std::cout << std::endl;
}
// Add a new entry
email["bill"] = "bg@whatever.com";
// and print it
std::cout << "bill's email is: " << email["bill"] << "\n";
return 0;
}