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

  • <small id='UD29f'></small><noframes id='UD29f'>

  • <legend id='UD29f'><style id='UD29f'><dir id='UD29f'><q id='UD29f'></q></dir></style></legend>

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

        <tfoot id='UD29f'></tfoot>

        如何在 C++ 中實(shí)現(xiàn)無操作宏(或模板)?

        How do I implement no-op macro (or template) in C++?(如何在 C++ 中實(shí)現(xiàn)無操作宏(或模板)?)
          <tbody id='nv2YZ'></tbody>
      1. <tfoot id='nv2YZ'></tfoot>
          <i id='nv2YZ'><tr id='nv2YZ'><dt id='nv2YZ'><q id='nv2YZ'><span id='nv2YZ'><b id='nv2YZ'><form id='nv2YZ'><ins id='nv2YZ'></ins><ul id='nv2YZ'></ul><sub id='nv2YZ'></sub></form><legend id='nv2YZ'></legend><bdo id='nv2YZ'><pre id='nv2YZ'><center id='nv2YZ'></center></pre></bdo></b><th id='nv2YZ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='nv2YZ'><tfoot id='nv2YZ'></tfoot><dl id='nv2YZ'><fieldset id='nv2YZ'></fieldset></dl></div>

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

          <legend id='nv2YZ'><style id='nv2YZ'><dir id='nv2YZ'><q id='nv2YZ'></q></dir></style></legend>
            <bdo id='nv2YZ'></bdo><ul id='nv2YZ'></ul>

                1. 本文介紹了如何在 C++ 中實(shí)現(xiàn)無操作宏(或模板)?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送ChatGPT賬號..

                  如何在 C++ 中實(shí)現(xiàn) no-op 宏?

                  How do I implement no-op macro in C++?

                  #include <iostream>   
                  
                  #ifdef NOOP       
                      #define conditional_noop(x) what goes here?   
                  #else       
                      #define conditional_noop(x) std::cout << (x)   
                  #endif   
                  int main() {       
                      conditional_noop(123);   
                  }
                  

                  我希望在定義 NOOP 時不執(zhí)行任何操作,并在未定義 NOOP 時打印123".

                  I want this to do nothing when NOOP is defined and print "123", when NOOP is not defined.

                  推薦答案

                  如前所述 - 沒有.
                  此外,您的代碼中存在印刷錯誤.
                  它應(yīng)該是 #else 而不是 #elif.如果是#elif,則后面跟著新的條件

                  As mentioned before - nothing.
                  Also, there is a misprint in your code.
                  it should be #else not #elif. if it is #elif it is to be followed by the new condition

                  #include <iostream>   
                  
                  #ifdef NOOP       
                      #define conditional_noop(x) do {} while(0)
                  #else       
                      #define conditional_noop(x) std::cout << (x)   
                  #endif  
                  

                  玩得開心編碼!按照另一個答案中的建議添加了 [do] 結(jié)構(gòu)以提高穩(wěn)健性.

                  Have fun coding! added the [do] construct for robustness as suggested in another answer.

                  這篇關(guān)于如何在 C++ 中實(shí)現(xiàn)無操作宏(或模板)?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 不能)
                    <bdo id='SHQiI'></bdo><ul id='SHQiI'></ul>
                    <tfoot id='SHQiI'></tfoot>

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

                      • <small id='SHQiI'></small><noframes id='SHQiI'>

                            <tbody id='SHQiI'></tbody>
                          1. 主站蜘蛛池模板: 欧美三级在线 | 久久亚洲一区二区 | 成人午夜免费福利视频 | 精品久久久久久 | 人人99| 高清国产一区二区 | 热久久久久 | 国产不卡一区 | 国产一区二区三区在线 | 在线黄色影院 | 99视频免费在线 | 精产国产伦理一二三区 | 亚洲精品小视频在线观看 | 欧美a在线 | 欧美日韩免费在线 | 亚洲欧美一区二区三区情侣bbw | 91观看| av一区二区在线观看 | 欧美精品久久久久久久久久 | 久久精品免费一区二区 | 精品亚洲一区二区 | 精品视频在线观看 | 红色av社区| 在线第一页 | 国产精品激情 | 欧美二区三区 | 操久久| 久久精品综合网 | 99国内精品 | 亚洲黄色av网站 | 欧美一区2区三区4区公司二百 | 国产乱码精品1区2区3区 | 一区二区av在线 | www亚洲一区 | 日韩成年人视频在线 | 波多野结衣二区 | 波多野结衣一区二区三区在线观看 | 国产精品污www在线观看 | 精品久久一区 | 国产不卡一 | 亚洲高清视频一区 |