{"author_name":"Ox8000ffff","author_url":"https://blog.hatena.ne.jp/Ox8000ffff/","version":"1.0","url":"https://ox8000ffff.hatenadiary.org/entry/20100226/1267201765","title":"std::map - insert \u6642\u306e\u7121\u99c4\u306a find \u3092\u9632\u3050","published":"2010-02-26 01:29:25","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fox8000ffff.hatenadiary.org%2Fentry%2F20100226%2F1267201765\" title=\"std::map - insert \u6642\u306e\u7121\u99c4\u306a find \u3092\u9632\u3050 - yanaken@phper\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_url":"https://hatena.blog","height":"190","image_url":null,"blog_url":"https://ox8000ffff.hatenadiary.org/","provider_name":"Hatena Blog","width":"100%","blog_title":"yanaken@phper","type":"rich","categories":["C++","STL"],"description":"std::map \u4f7f\u7528\u6642\u306b\u3001 \u300c\u633f\u5165\u3055\u305b\u305f\u3044\u30ad\u30fc\u304c\u65e2\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u304b\u30c1\u30a7\u30c3\u30af\u3057\u305f\u3044\u300d \u3063\u3066\u3053\u3068\u304c\u3088\u304f\u3042\u308b\u3002 \u305d\u3093\u306a\u6642\u306f insert \u306e\u623b\u308a\u5024\u3092\u4f7f\u7528\u3059\u308b\u3002 std::map<int, char> hige; hige.insert(1, 'a'); ... std::map<int, char>::_Pairib pib = hige.insert(1, 'b'); if (!pib.second) { // \u30ad\u30fc\u304c\u91cd\u8907\u3057\u3066\u3044\u308b } [\u8aac\u660e] _Pairib \u306e\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u8997\u3044\u3066\u307f\u308b\u3002 // _Pairib = _Pair + i(terator) + b(ool) typedef pair\u2026"}