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

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

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

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

        為什么要捕獲異常作為對 const 的引用?

        Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
        <i id='h4dZi'><tr id='h4dZi'><dt id='h4dZi'><q id='h4dZi'><span id='h4dZi'><b id='h4dZi'><form id='h4dZi'><ins id='h4dZi'></ins><ul id='h4dZi'></ul><sub id='h4dZi'></sub></form><legend id='h4dZi'></legend><bdo id='h4dZi'><pre id='h4dZi'><center id='h4dZi'></center></pre></bdo></b><th id='h4dZi'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='h4dZi'><tfoot id='h4dZi'></tfoot><dl id='h4dZi'><fieldset id='h4dZi'></fieldset></dl></div>
        • <bdo id='h4dZi'></bdo><ul id='h4dZi'></ul>
              <tbody id='h4dZi'></tbody>
            <tfoot id='h4dZi'></tfoot><legend id='h4dZi'><style id='h4dZi'><dir id='h4dZi'><q id='h4dZi'></q></dir></style></legend>
            1. <small id='h4dZi'></small><noframes id='h4dZi'>

                • 本文介紹了為什么要捕獲異常作為對 const 的引用?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我多次聽說并閱讀過,最好將異常作為對常量的引用而不是作為引用來捕獲.為什么是:

                  I've heard and read many times that it is better to catch an exception as reference-to-const rather than as reference. Why is:

                  try {
                      // stuff
                  } catch (const std::exception& e) {
                      // stuff
                  }
                  

                  優于:

                  try {
                      // stuff
                  } catch (std::exception& e) {
                      // stuff
                  }
                  

                  推薦答案

                  您需要:

                  • 一個引用,以便您可以多態地訪問異常
                  • 用于提高性能的常量,并告訴編譯器您不會修改對象

                  后者不如前者重要,但放棄 const 的唯一真正原因是表明您想要對異常進行更改(通常只有在您想要更改時才有用)將添加的上下文重新拋出到更高級別).

                  The latter is not as much important as the former, but the only real reason to drop const would be to signal that you want to do changes to the exception (usually useful only if you want to rethrow it with added context into a higher level).

                  這篇關于為什么要捕獲異常作為對 const 的引用?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                  When and how should I use exception handling?(我應該何時以及如何使用異常處理?)
                  Scope of exception object in C++(C++中異常對象的范圍)
                  Catching exceptions from a constructor#39;s initializer list(從構造函數的初始化列表中捕獲異常)
                  Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區別)
                  Should the exception thrown by boost::asio::io_service::run() be caught?(應該捕獲 boost::asio::io_service::run() 拋出的異常嗎?)
                  <i id='Ejhlu'><tr id='Ejhlu'><dt id='Ejhlu'><q id='Ejhlu'><span id='Ejhlu'><b id='Ejhlu'><form id='Ejhlu'><ins id='Ejhlu'></ins><ul id='Ejhlu'></ul><sub id='Ejhlu'></sub></form><legend id='Ejhlu'></legend><bdo id='Ejhlu'><pre id='Ejhlu'><center id='Ejhlu'></center></pre></bdo></b><th id='Ejhlu'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Ejhlu'><tfoot id='Ejhlu'></tfoot><dl id='Ejhlu'><fieldset id='Ejhlu'></fieldset></dl></div>
                    <tbody id='Ejhlu'></tbody>

                      <legend id='Ejhlu'><style id='Ejhlu'><dir id='Ejhlu'><q id='Ejhlu'></q></dir></style></legend>
                      • <bdo id='Ejhlu'></bdo><ul id='Ejhlu'></ul>
                      • <small id='Ejhlu'></small><noframes id='Ejhlu'>

                          • <tfoot id='Ejhlu'></tfoot>
                            主站蜘蛛池模板: 中文字幕人成乱码在线观看 | 国产精品久久久久久久久久三级 | av在线一区二区 | 日韩欧美精品在线 | 91精品国产91久久久久福利 | 午夜视频在线观看一区二区 | 久久综合影院 | 欧美日韩a | 在线播放国产视频 | 欧美一级二级在线观看 | 日韩欧美理论片 | 国产成人福利在线观看 | 在线中文字幕av | 精品国产1区2区3区 一区二区手机在线 | 91精品久久久久久久久 | 久久久蜜臀国产一区二区 | 国产精品视频97 | 日韩一区二区在线视频 | 69av在线视频 | 欧美aⅴ片| 在线免费观看视频黄 | 久久9视频 | 日韩久久久久久 | 亚洲欧美日韩精品久久亚洲区 | 国产精品美女久久久久aⅴ国产馆 | 免费h在线 | 国产操操操 | 免费观看成人鲁鲁鲁鲁鲁视频 | 中文字幕一区二区三区精彩视频 | 国产传媒视频在线观看 | 日韩中文字幕高清 | 人碰人操 | 成人在线不卡 | 91国产在线视频在线 | 91超碰在线观看 | 91精品中文字幕一区二区三区 | 成人av在线大片 | 久久久中文 | 亚洲精品99 | 日韩一区二区在线视频 | 奇米影视77|