<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Takachan</author_name>
  <author_url>https://blog.hatena.ne.jp/Takachan/</author_url>
  <blog_title>PG日誌</blog_title>
  <blog_url>https://takap-tech.com/</blog_url>
  <categories>
    <anon>C++</anon>
    <anon>C++11以上</anon>
  </categories>
  <description>C++の連想配列クラスのstd::mapの、テーブル内にキーが存在するかどうか確認するための方法の紹介です。 ものすごーく古くからあるクラスなので若干クセがあります。 C++20ならcontainsメソッドを使う C++20であればmapにcontainsというメソッドが追加されているので（ほかの近代的なライブラリ同様に）以下の操作で簡単にキーの存在を確認することができます。 #include &lt;map&gt; using namespace std; void foo() { map&lt;int, int&gt; map { { 1, 1 }, { 2, 2 }, { 3, 3 } }; if (map.c…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakap-tech.com%2Fentry%2F2019%2F06%2F01%2F233534&quot; title=&quot;C++でstd::mapにキーが存在するか調べる（C++20含む - PG日誌&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/T/Takachan/20190305/20190305234738.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-06-01 23:35:34</published>
  <title>C++でstd::mapにキーが存在するか調べる（C++20含む</title>
  <type>rich</type>
  <url>https://takap-tech.com/entry/2019/06/01/233534</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
