久久久久久久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网站 | 免费的黄色小视频 | 四虎网站在线观看 | 亚洲aaa| 成年人免费看视频 | 天天综合色 | 精品一区二区在线播放 | 亚洲视频在线观看一区 | 中文天堂在线观看 | 顶级黄色片 | 在线免费成人 | 99热最新| 欧美激情视频在线 | 国产精品天美传媒入口 | 午夜在线免费观看 | 久久伊人网站 | 日韩精品三级 | 97视频免费在线观看 | 免费看黄色小视频 | 久久久久国产一区二区三区 | 国产精品成人一区 | 麻豆精品久久 | 日韩999| 日本毛片在线观看 | 日韩欧美影院 | 999在线视频 | 日本美女黄色 | 日韩福利在线 | 成人在线一区二区 | 懂色av一区二区夜夜嗨 | a视频在线免费观看 | 亚洲黄色在线 | av网站在线播放 | 中文字幕亚洲天堂 | 亚洲黄色片| 亚洲第一伊人 | 亚洲国产成人精品久久 | 第一福利视频 | 日韩理论在线 | 毛片免费在线观看 | 日韩中文字幕视频 |