久久久久久久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'>

        應(yīng)該 std::unique_ptr<void>被允許

        Should std::unique_ptrlt;voidgt; be permitted(應(yīng)該 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. 本文介紹了應(yīng)該 std::unique_ptr<void>被允許的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送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)進(jìn)行編譯時出現(xiàn)此錯誤:

                  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
                          ]
                  

                  這是預(yù)期的嗎?我正在寫一個類,我想在類中擁有一個唯一的指針.在嘗試為類計算移動構(gòu)造函數(shù)的語義時,我遇到了這個問題(我假設(shè)是因?yàn)槲易罱K正確編碼了移動構(gòu)造函數(shù):即其他錯誤已修復(fù)).

                  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:

                  標(biāo)準(zhǔn)(3.9/5):

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

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

                  標(biāo)準(zhǔn)(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

                  這篇關(guān)于應(yīng)該 std::unique_ptr<void>被允許的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Why do two functions have the same address?(為什么兩個函數(shù)的地址相同?)
                  Why the initializer of std::function has to be CopyConstructible?(為什么 std::function 的初始化程序必須是可復(fù)制構(gòu)造的?)
                  mixing templates with polymorphism(混合模板與多態(tài)性)
                  When should I use the keyword quot;typenamequot; when using templates(我什么時候應(yīng)該使用關(guān)鍵字“typename?使用模板時)
                  Dependent name resolution amp; namespace std / Standard Library(依賴名稱解析命名空間 std/標(biāo)準(zhǔn)庫)
                  gcc can compile a variadic template while clang cannot(gcc 可以編譯可變參數(shù)模板,而 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一区 | 欧洲亚洲精品久久久久 | 日韩欧美国产电影 | 欧美九九| 蜜桃毛片 | 一区二区成人 | 亚洲最色网站 | 欧美日韩高清一区二区三区 | 欧美成年网站 | 亚洲精品av在线 | 久久国产成人 | 一级毛片视频 | 男女污污动态图 | www.一级毛片 | 欧美三区视频 | 天堂资源最新在线 | 在线第一页 | 国产高清在线 | 日韩精品一区二区三区久久 | 国产在线视频三区 | 免费精品在线视频 | 亚洲精品欧洲 | 超碰97免费观看 | 在线91| 精品国产乱码久久久久久闺蜜 | 日韩精品一区二区久久 | 中文字幕日韩欧美一区二区三区 | 国产精品久久久久久吹潮 | 亚洲欧美一区二区三区国产精品 | 99热在线播放 | 久久精品国产一区二区电影 | 中国xxxx性xxxx产国 | 91原创视频在线观看 | 激情毛片 | 亚洲a在线观看 | 黄视频网址 | 华丽的挑战在线观看 |