MCPcopy Create free account
hub / github.com/0voice/cpp_new_features / main

Function main

cpp_17/010_map_extract.cpp:6–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5#include <unordered_map>
6int main()
7{
8 using namespace std::literals;
9 std::unordered_map<std::string, std::string> m;
10
11 m.try_emplace("a", "a"s);
12 m.try_emplace("b", "abcd");
13 m.try_emplace("c", 10, 'c');
14 m.try_emplace("c", "Won't be inserted");
15
16 for (const auto &p : m) {
17 std::cout << p.first << " => " << p.second << '\n';
18 }
19}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected