MCPcopy Create free account
hub / github.com/andreasfertig/programming-with-cpp20 / main

Function main

10.17-mapContains0/main.cpp:8–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include <string>
7
8int main()
9{
10 const std::map<int, std::string> cppStds = {
11 {11, "C++11"}, {14, "C++14"}, {17, "C++17"}, {20, "C++20"}};
12
13 const int key = 20;
14
15 if(cppStds.find(key) != cppStds.end()) {
16 std::cout << "Found\n";
17 } else {
18 std::cout << "Not found\n";
19 }
20}

Callers

nothing calls this directly

Calls 1

endMethod · 0.45

Tested by

no test coverage detected