Skip to content

Instantly share code, notes, and snippets.

@kittinunf
Last active April 1, 2016 08:01
Show Gist options
  • Save kittinunf/3662e38792432103a0d18f3ccdaaf27d to your computer and use it in GitHub Desktop.
Save kittinunf/3662e38792432103a0d18f3ccdaaf27d to your computer and use it in GitHub Desktop.
std::unordered_map<std::string,std::string> m{{"1", "2"}, {"3", "4"}, {"5", "6"}};
std::unordered_map<std::string,std::string> ms;
std::transform(std::begin(m), std::end(m), std::inserter(ms, std::begin(ms)), [](const auto& p) { return {p.first, p.first}; };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment