Created
March 28, 2017 21:53
-
-
Save milesrout/3bc652c96ad5c782db101e6af206b3aa to your computer and use it in GitHub Desktop.
This file contains hidden or 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 <map> | |
using namespace std; | |
struct person { std::string first, last; }; | |
int main() { | |
std::map<std::string, person> m; | |
if (auto [_, was_inserted] = m.emplace("43662121", person{"Miles", "Rout"}); was_inserted) { | |
std::cout << "Student 43662121 was added to the map"; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment