{"id":1802,"date":"2016-12-20T17:08:45","date_gmt":"2016-12-20T09:08:45","guid":{"rendered":"http:\/\/myblog.emhct.net.cn\/?p=1802"},"modified":"2016-12-20T17:16:11","modified_gmt":"2016-12-20T09:16:11","slug":"%e3%80%90%e8%84%91%e7%ad%8b%e6%80%a5%e8%bd%ac%e5%bc%af%e3%80%91%e5%88%a9%e7%94%a8set%e5%92%8cvector%e5%81%9a%e6%8e%92%e5%ba%8f%e3%80%81%e5%8e%bb%e9%87%8d","status":"publish","type":"post","link":"http:\/\/myblog.emhct.net.cn\/index.php\/archives\/1802","title":{"rendered":"\u3010\u8111\u7b4b\u6025\u8f6c\u5f2f\u3011\u5229\u7528set\u548cvector\u505a\u6392\u5e8f\u3001\u53bb\u91cd"},"content":{"rendered":"<p>\u5728\u770bwebrtc\u7684\u4ee3\u7801\u65f6\uff0c\u9047\u5230\u4e00\u4e2aip\u5730\u5740\u6c60\u5728set\u548cvector\u4e2d\u98a0\u6765\u5012\u53bb\u7684\u4ee3\u7801\uff0c\u9876\u7740\u770b\u4e86\u4e00\u4f1a\uff0c\u540e\u6765\u624d\u53cd\u5e94\u8fc7\u6765\u3002\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nstd::set&lt;rtc::SocketAddress&gt; addrs(all_servers_addrs_.begin(),all_servers_addrs_.end());\r\nall_servers_addrs_.assign(addrs.begin(), addrs.end());\r\n<\/pre>\n<p>\u539f\u5148\u5728all_servers_addrs_\u4e2d\u5df2\u7ecf\u4fdd\u5b58\u4e86\u4e00\u4e2aip\u5217\u8868\uff0c\u901a\u8fc7\u5bfc\u5230set\u4e4b\u540e\uff0c\u9996\u5148\u53bb\u91cd\u4e86ip\uff0c\u63a5\u7740\u518d\u6309\u7167&#8217;&gt;&#8217;\u7b97\u672f\u8fd0\u7b97\u7b26\u6765\u8fdb\u884c\u6392\u5e8f\uff0c\u63a5\u7740\u5728\u901a\u8fc7assign\u5c06\u6392\u5e8f\u53bb\u91cd\u540e\u7684\u6570\u636e\u8fd4\u56devector\u3002<\/p>\n<p>\u8fd9\u6837\u505a\u7684\u597d\u5904\u5728\u4e8e\uff0c\u65f6\u95f4\u590d\u6742\u5ea6\u4e3aset\u6392\u5e8f\u590d\u6742\u5ea6+set\u968f\u673a\u8bbf\u95ee\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u7684\u603b\u548c\uff0c\u5927\u81f4\u53ef\u4ee5\u907f\u514dvector\uff08\u7c7b\u4f3c\u7ebf\u6027\u8868\uff09\u7684\u8f83\u9ad8\u63d2\u5165\u5220\u9664\u590d\u6742\u5ea6\u7684\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u770bwebrtc\u7684\u4ee3\u7801\u65f6\uff0c\u9047\u5230\u4e00\u4e2aip\u5730\u5740\u6c60\u5728set\u548cvector\u4e2d\u98a0\u6765\u5012\u53bb\u7684\u4ee3\u7801\uff0c\u9876\u7740\u770b\u4e86\u4e00\u4f1a\uff0c\u540e\u6765\u624d\u53cd\u5e94\u8fc7\u6765\u3002\u4ee3\u7801\u5982\u4e0b\uff1a std::set&lt;rtc::SocketAddress&gt; addrs(all_servers_addrs_.begin(),all_servers_addrs_.end()); al &hellip;<\/p>\n<p class=\"read-more\"><a href=\"http:\/\/myblog.emhct.net.cn\/index.php\/archives\/1802\">read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86,3,47],"tags":[],"class_list":["post-1802","post","type-post","status-publish","format-standard","hentry","category-stupid_somebody","category-ThinkAbout","category-ProgramSkill"],"_links":{"self":[{"href":"http:\/\/myblog.emhct.net.cn\/index.php\/wp-json\/wp\/v2\/posts\/1802","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/myblog.emhct.net.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/myblog.emhct.net.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/myblog.emhct.net.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/myblog.emhct.net.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1802"}],"version-history":[{"count":5,"href":"http:\/\/myblog.emhct.net.cn\/index.php\/wp-json\/wp\/v2\/posts\/1802\/revisions"}],"predecessor-version":[{"id":1807,"href":"http:\/\/myblog.emhct.net.cn\/index.php\/wp-json\/wp\/v2\/posts\/1802\/revisions\/1807"}],"wp:attachment":[{"href":"http:\/\/myblog.emhct.net.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/myblog.emhct.net.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1802"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/myblog.emhct.net.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}