Skip to content

Instantly share code, notes, and snippets.

@ahmetaa
Created November 7, 2019 10:45
Show Gist options
  • Save ahmetaa/8f901775ecb4b48a3e12ae12cc4fb84a to your computer and use it in GitHub Desktop.
Save ahmetaa/8f901775ecb4b48a3e12ae12cc4fb84a to your computer and use it in GitHub Desktop.
#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