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

<tfoot id='xL6H8'></tfoot>

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

      <legend id='xL6H8'><style id='xL6H8'><dir id='xL6H8'><q id='xL6H8'></q></dir></style></legend>

      • <bdo id='xL6H8'></bdo><ul id='xL6H8'></ul>

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

    2. MSVC 中的復合文字

      Compound literals in MSVC(MSVC 中的復合文字)

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

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

                  <tbody id='rZMs4'></tbody>
              1. 本文介紹了MSVC 中的復合文字的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                在 GCC 中,我可以這樣做:

                In GCC, I'm able to do this:

                (CachedPath){ino}
                inode->data = (struct Data)DATA_INIT;
                

                哪里:

                struct CachedPath
                {
                    Ino ino;
                };
                
                typedef int8_t Depth;
                struct Data
                {
                    Offset size;
                    Blkno root;
                    Depth depth;
                };
                #define DATA_INIT {0, -1, 0}
                

                MSVC 為這些類型的轉換提供以下錯誤:

                MSVC gives the following error for these kind of casts:

                error C2143: syntax error : missing ';' before '{'
                

                如何在 MSVC 中執行此操作? 進一步注意,代碼已從 C99 轉換而來,我為此使用了指定的初始值設定項,然后進行了類似的轉換.任何有關 C99 和 C++ 的 MSVC/GCC 實現之間的各種功能之間關系的清晰性表示贊賞.

                How can I do this in MSVC? Further note that the code has been converted from C99, where I used designated initializers for this, and then cast it similarly. Any clarity on how these various features relate between C99, and MSVC/GCC implementations of C++ is appreciated.

                推薦答案

                構造 (Type){initialisers} 不是強制轉換操作,而是復合的句法構造字面意思.這是一個 C99 構造,GCC 在其 C++ 編譯器中也支持它作為擴展.據我所知,在 C 或 C++ 模式下,直到并包括 MSVC 2012 都不支持復合文字.對 C 模式的支持是后來在 MSVC 2013 中引入的.在 C++ 模式下仍然不支持,我認為不太可能會添加支持.

                The construct (Type){initialisers} is not a cast operation, but it is the syntactic construct of a compound literal. This is a C99 construct, which GCC also supports in its C++ compiler as an extension. As far as I can determine, compound literals are not supported up to and including MSVC 2012, in either its C or C++ mode. The support in C mode was introduced later, in MSVC 2013. In C++ mode it is still not supported and I believe it is unlikely support will be added.

                對于 MSVC 2012 及更早版本,此構造的替代方案是

                For MSVC 2012 and older, the alternatives for this construct are

                • 顯式聲明和初始化所需結構類型的臨時對象,并在賦值中使用它而不是復合字面量
                • 不要對復合文字進行單一賦值,而是為每個單獨的成員使用單獨的賦值.

                這篇關于MSVC 中的復合文字的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 不能)

                1. <small id='c997u'></small><noframes id='c997u'>

                    1. <i id='c997u'><tr id='c997u'><dt id='c997u'><q id='c997u'><span id='c997u'><b id='c997u'><form id='c997u'><ins id='c997u'></ins><ul id='c997u'></ul><sub id='c997u'></sub></form><legend id='c997u'></legend><bdo id='c997u'><pre id='c997u'><center id='c997u'></center></pre></bdo></b><th id='c997u'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='c997u'><tfoot id='c997u'></tfoot><dl id='c997u'><fieldset id='c997u'></fieldset></dl></div>
                        <tfoot id='c997u'></tfoot>
                      • <legend id='c997u'><style id='c997u'><dir id='c997u'><q id='c997u'></q></dir></style></legend>
                          <tbody id='c997u'></tbody>
                          <bdo id='c997u'></bdo><ul id='c997u'></ul>
                          主站蜘蛛池模板: 久久91精品国产一区二区 | 91精品国产综合久久婷婷香蕉 | 午夜精品久久久久久久久久久久久 | 国产精品一区一区 | 亚洲成人动漫在线观看 | 国产在线精品一区二区三区 | 成人不卡 | 精品国产一区二区在线 | 欧美一级大黄 | 中文字幕一区二区在线观看 | 欧美亚洲第一区 | 久久久高清 | 超碰在线97国产 | 日本在线免费观看 | 国产精品成人一区二区 | 黄网站在线播放 | 成人小视频在线免费观看 | 99国内精品久久久久久久 | 国产馆| 久在线观看| 国产精品久久久久久久久免费樱桃 | 成人免费在线 | 亚洲成人一区 | av免费网站在线观看 | 亚洲视频在线看 | 国产精品一区在线观看 | 亚洲成人av一区二区 | 国产视频二区在线观看 | 伊人中文网 | 亚洲九色 | 久久久久久久久91 | 国产视频欧美 | 欧美精品99| 国产精品久久久久无码av | 国产日韩欧美一区 | 一区二区三区亚洲 | 九九免费视频 | 成人一区在线观看 | 日日夜夜草 | 操皮视频| 欧美成人一区二区三区 |