{"id":207573,"date":"2020-11-26T21:00:59","date_gmt":"2020-11-26T13:00:59","guid":{"rendered":"http:\/\/4563.org\/?p=207573"},"modified":"2020-11-26T21:00:59","modified_gmt":"2020-11-26T13:00:59","slug":"vscode-%e8%af%af%e6%8a%a5%e8%af%ad%e6%b3%95%e9%94%99%e8%af%af","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=207573","title":{"rendered":"VSCode \u8bef\u62a5\u8bed\u6cd5\u9519\u8bef"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  VSCode \u8bef\u62a5\u8bed\u6cd5\u9519\u8bef               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : o2hard <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6211\u5728 mac osx \u4e0a\u7528 vscode \u5199 c++\uff0c\u7528\u7684\u5fae\u8f6f\u5b98\u65b9\u7684 c++\u6269\u5c55\uff0c\u8fd0\u884c\u53c2\u6570\u7528\u7684\u662f<code>g++ -std=c++2a<\/code>\u3002XCode \u81ea\u5e26<code>clang<\/code>\uff0c\u8f93\u5165<code>g++<\/code>\u4f1a\u81ea\u52a8\u8fde\u63a5\u4f7f\u7528<code>clang<\/code>\uff0c\u6211\u53e6\u5916\u4e0b\u4e86\u4e2a<code>gcc\/g++<\/code>\uff0c\u5728<code>zshrc<\/code>\u4e2d\u5199\u5165<code>alias gcc='gcc-10' alias g++='g++-10'<\/code>\uff0c\u73b0\u5728\u8f93\u5165<code>g++ --version<\/code>\u663e\u793a\u7684\u662f<code>g++-10 (Homebrew GCC 10.2.0) 10.2.0<\/code>\u3002\u6211\u73b0\u5728\u5199\u4e00\u4e9b c++17 \u53ca\u4ee5\u540e\u7684\u8bed\u6cd5\uff0c\u6bd4\u5982<code>std::vector arr;<\/code> \u7a0b\u5e8f\u7f16\u8bd1\u8fd0\u884c\u6ca1\u95ee\u9898\uff0c\u4f46\u4f1a\u6709\u7ea2\u8272\u6ce2\u6d6a\u7ebf\u63d0\u793a\u9519\u8bef\uff08 argument list for class template &#8220;std::vector&#8221; is missing \uff09\uff0c\u800c\u4e14\u8be5\u6bb5\u4ee3\u7801\u7f16\u8f91\u5668\u6ca1\u6709\u8bed\u6cd5\u9ad8\u4eae\u3002\u6362\u6210<code>std::vector&lt;int&gt; arr;<\/code>\u4e4b\u540e\u9519\u8bef\u8b66\u544a\u5c31\u6d88\u5931\u4e86\uff0c\u4ee3\u7801\u7684\u8bed\u6cd5\u9ad8\u4eae\u4e5f\u6b63\u786e\u4e86\u3002\u8fd9\u662f\u54ea\u91cc\u8bbe\u7f6e\u51fa\u95ee\u9898\u4e86\uff0c\u9700\u8981\u54ea\u91cc\u518d\u53e6\u5916\u8bbe\u7f6e\u5417\uff1f\u73b0\u5728\u7684\u4ee3\u7801\u8bed\u6cd5\u68c0\u6d4b\u7528\u7684\u597d\u50cf\u6ca1\u6709\u7528\u5230\u6700\u65b0\u7684<code>std<\/code>\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>4<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4253012\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : seasona <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             std::vector arr;\u6ca1\u7ed9\u6a21\u677f\u53c2\u6570\u7c7b\u578b\u662f\u600e\u4e48\u80fd\u8fc7\u7f16\u8bd1\u7684\uff0c\u5c31\u7b97\u662f\u63a8\u5bfc\u6307\u5f15\u4e5f\u5f97\u7ed9\u4e2a\u8fed\u4ee3\u5668\u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4253013\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Athrob <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             std::vector arr;\u771f\u7684\u80fd\u7f16\u8bd1\u901a\u8fc7\u5417, https:\/\/en.cppreference.com\/w\/cpp\/container\/vector \u8fd9\u91cc\u4e5f\u6ca1\u6709\u4f60\u8bf4\u7684\u8fd9\u79cd\u58f0\u660e\u554a.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4253014\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nightwitch <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u8bf4 std::vector arr{1,2,3}\u80fd\u7f16\u8bd1\u8fc7\u6211\u4fe1\uff0cstd::vector arr;\u80fd\u7f16\u8bd1\u8fc7\u90a3\u6211\u4e0d\u4fe1\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4253015\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Meltdown <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5dee\u70b9\u4ee5\u4e3a\u65b0\u6807\u51c6\u90fd\u4e0d\u7528\u6307\u5b9a\u7c7b\u578b\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>VSCode \u8bef\u62a5\u8bed\u6cd5\u9519\u8bef \u8cc7\u6df1\u5927&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/207573"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=207573"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/207573\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=207573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=207573"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=207573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}