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

    <tfoot id='Sn4ZT'></tfoot>
        <bdo id='Sn4ZT'></bdo><ul id='Sn4ZT'></ul>
      <legend id='Sn4ZT'><style id='Sn4ZT'><dir id='Sn4ZT'><q id='Sn4ZT'></q></dir></style></legend>
    1. <i id='Sn4ZT'><tr id='Sn4ZT'><dt id='Sn4ZT'><q id='Sn4ZT'><span id='Sn4ZT'><b id='Sn4ZT'><form id='Sn4ZT'><ins id='Sn4ZT'></ins><ul id='Sn4ZT'></ul><sub id='Sn4ZT'></sub></form><legend id='Sn4ZT'></legend><bdo id='Sn4ZT'><pre id='Sn4ZT'><center id='Sn4ZT'></center></pre></bdo></b><th id='Sn4ZT'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Sn4ZT'><tfoot id='Sn4ZT'></tfoot><dl id='Sn4ZT'><fieldset id='Sn4ZT'></fieldset></dl></div>
      1. <small id='Sn4ZT'></small><noframes id='Sn4ZT'>

        應該 std::unique_ptr<void>被允許

        Should std::unique_ptrlt;voidgt; be permitted(應該 std::unique_ptrvoid被允許)
        <tfoot id='0YFvf'></tfoot>
      2. <legend id='0YFvf'><style id='0YFvf'><dir id='0YFvf'><q id='0YFvf'></q></dir></style></legend>

              <small id='0YFvf'></small><noframes id='0YFvf'>

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

                1. 本文介紹了應該 std::unique_ptr<void>被允許的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  這是一個非常簡單的問題.考慮以下代碼:

                  This is a very simple question. Consider the following code:

                  #include <iostream>
                  #include <memory>
                  
                  typedef std::unique_ptr<void> UniqueVoidPtr;
                  
                  int main() {
                      UniqueVoidPtr p(new int);
                      return 0;
                  }
                  

                  使用 cygwin (g++ 4.5.3) 和以下命令編譯 g++ -std=c++0x -o prog file.cpp 工作得很好.但是,使用 Microsoft 編譯器(VS 2010 或 2013)進行編譯時出現此錯誤:

                  Compiling with cygwin (g++ 4.5.3) with the following command g++ -std=c++0x -o prog file.cpp works just fine. However, compiling with the microsoft compiler (either VS 2010 or 2013) I get this error:

                  C:Program Files (x86)Microsoft Visual Studio 10.0VCINCLUDEmemory(2067) : error C2070: 'void': illegal sizeof operand
                          C:Program Files (x86)Microsoft Visual Studio 10.0VCINCLUDEmemory(2066) : while compiling class template member function 'void std::default_delete<_Ty>::operator ()(_Ty *) const'
                          with
                          [
                              _Ty=void
                          ]
                          C:Program Files (x86)Microsoft Visual Studio 10.0VCINCLUDE	ype_traits(650) : see reference to class template instantiation 'std::default_delete<_Ty>' being compiled
                          with
                          [
                              _Ty=void
                          ]
                          C:Program Files (x86)Microsoft Visual Studio 10.0VCINCLUDEmemory(2193) : see reference to class template instantiation 'std::tr1::is_empty<_Ty>' being compiled
                          with
                          [
                              _Ty=std::default_delete<void>
                          ]
                          foo1.cpp(7) : see reference to class template instantiation 'std::unique_ptr<_Ty>' being compiled
                          with
                          [
                              _Ty=void
                          ]
                  

                  這是預期的嗎?我正在寫一個類,我想在類中擁有一個唯一的指針.在嘗試為類計算移動構造函數的語義時,我遇到了這個問題(我假設是因為我最終正確編碼了移動構造函數:即其他錯誤已修復).

                  Is this expected? I'm writing a class where I wanted to have a unique pointer in the in the class. While trying to work out the semantics of a move constructor for the class, I ran into this (I assume because I finally got my move constructor coded correctly: i.e. the other errors were fixed).

                  推薦答案

                  MSVC 是對的,而 GCC 是錯的:

                  MSVC is right while GCC is wrong:

                  標準(3.9/5):

                  不完全定義的對象類型和void類型是不完全類型

                  Incompletely-defined object types and the void types are incomplete types

                  標準(20.7.1.1.2/4):

                  Standard(20.7.1.1.2/4):

                  如果 T 是不完整類型,則程序格式錯誤

                  If T is an incomplete type, the program is ill-formed

                  這篇關于應該 std::unique_ptr<void>被允許的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 不能)
                2. <tfoot id='SfjpI'></tfoot>
                3. <legend id='SfjpI'><style id='SfjpI'><dir id='SfjpI'><q id='SfjpI'></q></dir></style></legend>

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

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

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

                            主站蜘蛛池模板: 二区三区在线观看 | 高清免费av | 亚洲激情一区 | 欧美一级特黄aaaaaa | 亚洲激情在线 | 日韩在线不卡 | 欧美黄色精品 | 狠狠的操 | 麻豆一级片| 中文字幕网址在线 | 91午夜理伦私人影院 | 成人一级毛片 | www.黄色av | 免费黄色av网站 | 成人在线播放视频 | 久久中文字幕视频 | 视频一区在线观看 | 久久福利视频导航 | 亚洲精品91天天久久人人 | 国产三级黄色片 | 天天干夜夜草 | 97超碰资源 | 黄网站免费观看 | 日韩精品久久久久 | 成人黄色小视频 | 免费的一级片 | 午夜国产在线 | 久久在线精品 | 一级做a爰片久久毛片潮喷 视频一二区 | 欧美精品二区三区四区免费看视频 | 久久99久久久 | 国产精品久久一区 | 色天天综合网 | 久操av在线 | 国产一区二区三区在线视频 | 91精品久久久久 | 一级片av| 色av吧 | 日韩国产在线 | 少妇高潮露脸国语对白 | 国产欧美日韩一区二区三区 |