Created
November 7, 2019 10:45
-
-
Save ahmetaa/8f901775ecb4b48a3e12ae12cc4fb84a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <unordered_map> | |
class Bar { | |
public: | |
Bar()= default; | |
}; | |
class Foo { | |
public: | |
Foo()= default; | |
std::unordered_map<std::string, Bar*> haha_map; | |
void add(const std::string &blah, Bar *bar) { | |
haha_map.insert(std::make_pair(blah, bar)); | |
} | |
}; | |
int main() { | |
const std::string crap = "crap"; | |
Foo foo; | |
Bar *bar = new Bar(); | |
foo.add(crap, bar); | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment