{"id":14148,"date":"2023-07-18T11:39:50","date_gmt":"2023-07-18T11:39:50","guid":{"rendered":"https:\/\/blog.bachi.net\/?p=14148"},"modified":"2023-07-18T14:35:38","modified_gmt":"2023-07-18T14:35:38","slug":"c-map","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=14148","title":{"rendered":"C++ map"},"content":{"rendered":"<p><a href=\"https:\/\/www.cppstories.com\/2023\/fun-print-tables-format\/\">Fun with printing tables with std::format and C++20<\/a><br \/>\n<a href=\"https:\/\/www.cppstories.com\/2020\/03\/const-collection-of-uniqueptr-options.html\/\">Const collection of unique_ptr, options and design choices<\/a><\/p>\n<p><a href=\"https:\/\/www.freecodecamp.org\/news\/c-plus-plus-map-explained-with-examples\/\">C++ Map Explained with Examples<\/a><br \/>\n<a href=\"https:\/\/www.geeksforgeeks.org\/map-associative-containers-the-c-standard-template-library-stl\/\">Map in C++ Standard Template Library (STL)<\/a><\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/6963894\/how-to-use-range-based-for-loop-with-stdmap\">How to use range-based for() loop with std::map?<\/a><br \/>\n<a href=\"https:\/\/cplusplus.com\/reference\/map\/map\/at\/\">std::map::at<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/1939953\/how-to-find-if-a-given-key-exists-in-a-c-stdmap\">How to find if a given key exists in a C++ std::map<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/15178106\/c-stdmap-throws-an-out-of-range-exception\">C++: std::map throws an out_of_range exception<\/a><\/p>\n<p><a href=\"https:\/\/linuxhint.com\/at-map-cpp\/\">At Map C++<\/a><br \/>\n<a href=\"https:\/\/www.educba.com\/c-plus-plus-map-at\/\">C++ map at()<\/a><\/p>\n<pre class=\"brush: cpp; title: C++17; notranslate\" title=\"C++17\">\r\n\/\/ \r\nfor (const auto&amp; &#x5B;key, value]: myMap) {\r\n    std::cout &lt;&lt; key &lt;&lt; &quot; has value &quot; &lt;&lt; value &lt;&lt; std::endl;\r\n}\r\n<\/pre>\n<p><a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/structured_binding\">Structured binding declaration<\/a><br \/>\n<a href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20201014-00\/?p=104367\">A brief introduction to C++ structured binding<\/a><br \/>\n<a href=\"https:\/\/www.geeksforgeeks.org\/structured-binding-c\/\">Structured binding in C++<\/a><\/p>\n<pre class=\"brush: cpp; title: C++11 \/ C++14; notranslate\" title=\"C++11 \/ C++14\">\r\nfor (const auto&amp; kv : myMap) {\r\n    std::cout &lt;&lt; kv.first &lt;&lt; &quot; has value &quot; &lt;&lt; kv.second &lt;&lt; std::endl;\r\n}\r\n<\/pre>\n<p><a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/range-for\">Range-based for loop<\/a><br \/>\n<a href=\"https:\/\/www.geeksforgeeks.org\/range-based-loop-c\/\">Range-based for loop in C++<\/a><br \/>\n<a href=\"https:\/\/learn.microsoft.com\/en-us\/cpp\/cpp\/range-based-for-statement-cpp?view=msvc-170\">Range-based for Statement (C++)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Fun with printing tables with std::format and C++20 Const collection of unique_ptr, options and design choices C++ Map Explained with Examples Map in C++ Standard Template Library (STL) How to use range-based for() loop with std::map? std::map::at How to find if a given key exists in a C++ std::map C++: std::map throws an out_of_range exception [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-14148","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/14148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14148"}],"version-history":[{"count":8,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/14148\/revisions"}],"predecessor-version":[{"id":14162,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/14148\/revisions\/14162"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}