久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<small id='vvRZ6'></small><noframes id='vvRZ6'>

    <i id='vvRZ6'><tr id='vvRZ6'><dt id='vvRZ6'><q id='vvRZ6'><span id='vvRZ6'><b id='vvRZ6'><form id='vvRZ6'><ins id='vvRZ6'></ins><ul id='vvRZ6'></ul><sub id='vvRZ6'></sub></form><legend id='vvRZ6'></legend><bdo id='vvRZ6'><pre id='vvRZ6'><center id='vvRZ6'></center></pre></bdo></b><th id='vvRZ6'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='vvRZ6'><tfoot id='vvRZ6'></tfoot><dl id='vvRZ6'><fieldset id='vvRZ6'></fieldset></dl></div>
      <tfoot id='vvRZ6'></tfoot>
      • <bdo id='vvRZ6'></bdo><ul id='vvRZ6'></ul>

      1. <legend id='vvRZ6'><style id='vvRZ6'><dir id='vvRZ6'><q id='vvRZ6'></q></dir></style></legend>

        一個 VS2010 錯誤?允許在沒有警告的情況下綁定非

        One VS2010 bug ? Allowing binding non-const reference to rvalue WITHOUT EVEN a warning?(一個 VS2010 錯誤?允許在沒有警告的情況下綁定非常量引用到右值?)

          <legend id='gITts'><style id='gITts'><dir id='gITts'><q id='gITts'></q></dir></style></legend>
        • <tfoot id='gITts'></tfoot>

          <small id='gITts'></small><noframes id='gITts'>

              <i id='gITts'><tr id='gITts'><dt id='gITts'><q id='gITts'><span id='gITts'><b id='gITts'><form id='gITts'><ins id='gITts'></ins><ul id='gITts'></ul><sub id='gITts'></sub></form><legend id='gITts'></legend><bdo id='gITts'><pre id='gITts'><center id='gITts'></center></pre></bdo></b><th id='gITts'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='gITts'><tfoot id='gITts'></tfoot><dl id='gITts'><fieldset id='gITts'></fieldset></dl></div>

                <bdo id='gITts'></bdo><ul id='gITts'></ul>
                  <tbody id='gITts'></tbody>

                  本文介紹了一個 VS2010 錯誤?允許在沒有警告的情況下綁定非常量引用到右值?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..
                  string foo() { return "hello"; }
                  int main() 
                  {
                      //below should be illegal for binding a non-const (lvalue) reference to a rvalue
                      string& tem  = foo();   
                  
                      //below should be the correct one as only const reference can be bind to rvalue(most important const)
                      const string& constTem = foo();   
                  }
                  

                  1. GCC 是給出編譯錯誤的好方法:從 類型的臨時對象對 std::string& 類型的非常量引用無效初始化std::string
                  2. VS2008 還不錯,至少它給出了一個編譯警告:警告 C4239:使用了非標準擴展:正在初始化":從 std::stringstd::string & 的轉換 非常量引用只能綁定到左值
                  3. 問題來了 - VS2010(SP1) 沒有任何問題錯誤或警告,為什么??!!我知道 VS2010 中的 rvalue reference 可用于綁定 rvalue 但我沒有使用 &&,而是在演示代碼中,我只是使用非常量左值引用!
                  1. GCC is the good one to give a compile error: invalid initialization of non-const reference of type std::string& from a temporary of type std::string
                  2. VS2008 is not too bad as at least it gives a compile warning: warning C4239: nonstandard extension used : 'initializing' : conversion from std::string to std::string & A non-const reference may only be bound to an lvalue
                  3. Here comes the problematic one - VS2010(SP1) comples fine WITHOUT any error or warning, WHY ??!! I know rvalue reference in VS2010 can be used to bind with rvalue but I am NOT using &&, instead in the demo code, I was just using non-const lvalue reference !

                  這里有人能幫我解釋一下VS2010的行為嗎?是bug嗎!?謝謝

                  Can somone help me explain the behavior of VS2010 here? Is it a bug !? Thanks

                  推薦答案

                  這是 VS 編譯器的已知問題/功能.他們一直允許這樣做,并且似乎沒有任何推動刪除該擴展.

                  That is a known issue/feature of the VS compilers. They have always allowed that and there does not seem to be any push into removing that extension.

                  這篇關于一個 VS2010 錯誤?允許在沒有警告的情況下綁定非常量引用到右值?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Why do two functions have the same address?(為什么兩個函數的地址相同?)
                  Why the initializer of std::function has to be CopyConstructible?(為什么 std::function 的初始化程序必須是可復制構造的?)
                  mixing templates with polymorphism(混合模板與多態性)
                  When should I use the keyword quot;typenamequot; when using templates(我什么時候應該使用關鍵字“typename?使用模板時)
                  Dependent name resolution amp; namespace std / Standard Library(依賴名稱解析命名空間 std/標準庫)
                  gcc can compile a variadic template while clang cannot(gcc 可以編譯可變參數模板,而 clang 不能)

                  • <tfoot id='VFXqa'></tfoot>
                      <tbody id='VFXqa'></tbody>

                      <i id='VFXqa'><tr id='VFXqa'><dt id='VFXqa'><q id='VFXqa'><span id='VFXqa'><b id='VFXqa'><form id='VFXqa'><ins id='VFXqa'></ins><ul id='VFXqa'></ul><sub id='VFXqa'></sub></form><legend id='VFXqa'></legend><bdo id='VFXqa'><pre id='VFXqa'><center id='VFXqa'></center></pre></bdo></b><th id='VFXqa'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='VFXqa'><tfoot id='VFXqa'></tfoot><dl id='VFXqa'><fieldset id='VFXqa'></fieldset></dl></div>

                    1. <legend id='VFXqa'><style id='VFXqa'><dir id='VFXqa'><q id='VFXqa'></q></dir></style></legend>

                      <small id='VFXqa'></small><noframes id='VFXqa'>

                      • <bdo id='VFXqa'></bdo><ul id='VFXqa'></ul>
                            主站蜘蛛池模板: 99爱在线免费观看 | 黄 色 毛片免费 | 一区二区三区四区不卡视频 | 精品国产不卡一区二区三区 | 国产最新视频在线 | 欧美综合一区二区 | 国产专区免费 | 免费观看黄色片视频 | 久久国产精品久久久久久 | 91黄在线观看 | 亚洲图片视频一区 | 久久高清精品 | 免费一级淫片aaa片毛片a级 | 日韩精品一区二区三区 | 国产97碰免费视频 | 欧美日韩一二三区 | 国产黄色麻豆视频 | 久草新在线 | 国产一区亚洲二区三区 | www.三级 | 国产高清免费视频 | 国产一区二区三区在线免费 | 亚洲国产精品视频 | 日韩精品在线一区 | 欧美一区二区三区大片 | 人操人免费视频 | 中文字幕 在线观看 | 国产区在线观看 | 久久久久99 | 99热这里都是精品 | 国产日韩欧美电影 | 成人在线视频一区 | 日韩精品一区二区三区中文在线 | 日韩超碰在线 | 免费毛片网站 | 日韩毛片在线免费观看 | 中文在线一区二区 | 亚洲a人| 中文字幕在线观看视频一区 | 最新国产视频 | 国产亚洲精品一区二区三区 |