{"id":135568,"date":"2020-07-16T03:26:17","date_gmt":"2020-07-15T19:26:17","guid":{"rendered":"http:\/\/4563.org\/?p=135568"},"modified":"2020-07-16T03:26:17","modified_gmt":"2020-07-15T19:26:17","slug":"c-queue-%e4%b8%ad%e4%b8%8d%e5%8f%af%e4%bb%a5%e5%ad%98%e6%94%be-vectorint%e5%90%97%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=135568","title":{"rendered":"C++ queue \u4e2d\u4e0d\u53ef\u4ee5\u5b58\u653e vector&lt;int&gt;\u5417\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  C++ queue \u4e2d\u4e0d\u53ef\u4ee5\u5b58\u653e vector&lt;int&gt;\u5417\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 516310189i <\/span>  <span><i><\/i> 7<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>queue&lt;vector&lt;int&gt;&gt; q; \u5f53\u8c03\u7528 q.front()\u65f6\u4e3a\u4ec0\u4e48\u8fd4\u56de\u503c\u662f void \u5462<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>7<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2445030\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dbskcnc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5b8c\u5168\u6ca1\u95ee\u9898                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2445031\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : BrettD <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u600e\u4e48\u770b\u5230\u8fd4\u56de void \u7684\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2445032\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : 516310189i <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f7f\u7528 auto a = q.front();\u7684\u65f6\u5019\u4f1a\u63d0\u793a\u9519\u8bef<br \/>Cant instantiate the variables of type void<br \/>CLion \u91cc\u63d0\u793a\u4e5f\u663e\u793a front \u8fd4\u56de\u503c\u662f void                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2445033\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : coderfox <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             http:\/\/cpp.sh\/6cs3h<\/p>\n<p>\u6ca1\u6709\u53d1\u73b0\u8fd9\u4e2a\u95ee\u9898\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2445034\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wutiantong <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5148\u6539\u6210 std::queue&lt;std::vector&lt;int&gt;&gt;\u518d\u804a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2445035\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Akiyu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @516310189i <br \/>http:\/\/www.cplusplus.com\/reference\/queue\/queue\/front\/ <br \/>front \u4e0d\u4f1a\u8fd4\u56de void(\u81f3\u5c11\u4e0d\u662f void \u7c7b\u578b). <br \/>\u800c\u8fd4\u56de &#8220;\u7a7a&#8221; \u4ec5\u5728 queue \u4e3a\u7a7a\u7684\u60c5\u51b5\u4e0b. \u4f46\u662f\u5373\u4f7f\u8fd9\u6837, \u4e5f\u53ea\u4f1a\u5728\u4f7f\u7528\u8fd4\u56de\u503c\u65f6\u62a5\u9519. \u800c\u5e76\u975e\u5728 front \u8fd4\u56de\u7684\u65f6\u5019. <br \/>\u9664\u975e\u7f16\u8bd1\u5668\u6216\u8005\u6807\u51c6\u5e93\u505a\u4e86\u68c0\u67e5. \u4f46\u4e00\u822c\u4e0d\u4f1a\u8fd9\u6837. <br \/>\u65b9\u4fbf\u63d0\u4f9b\u4e00\u4e0b\u539f\u59cb\u4ee3\u7801, \u5e93\u548c\u7f16\u8bd1\u5668\u7684\u7248\u672c\u4e48?                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2445036\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : 516310189i <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u554a \u662f CLion \u7684\u95ee\u9898\uff0cCLion \u63d0\u793a\u9519\u8bef\uff0c\u4f46\u662f\u8fd0\u884c\u6ca1\u9519\uff0c\u662f\u6211\u50bb\u4e86\u3002\u611f\u8c22\u5927\u5bb6\uff1a\uff09                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>C++ queue \u4e2d\u4e0d\u53ef\u4ee5\u5b58\u653e &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\/135568"}],"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=135568"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/135568\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=135568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=135568"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=135568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}