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

    <tfoot id='pn9j1'></tfoot>

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

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

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

        C++ 捕獲所有異常

        C++ catching all exceptions(C++ 捕獲所有異常)

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

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

                <legend id='mnAWE'><style id='mnAWE'><dir id='mnAWE'><q id='mnAWE'></q></dir></style></legend>
                  <bdo id='mnAWE'></bdo><ul id='mnAWE'></ul>
                    <tbody id='mnAWE'></tbody>
                  <tfoot id='mnAWE'></tfoot>

                  本文介紹了C++ 捕獲所有異常的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  是否有 Java 的 C++ 等價物

                  Is there a c++ equivalent of Java's

                  try {
                      ...
                  }
                  catch (Throwable t) {
                      ...
                  }
                  

                  我正在嘗試調試調用本機 Windows 函數的 Java/jni 代碼,但虛擬機不斷崩潰.本機代碼在單元測試中看起來很好,只有在通過 jni 調用時才會崩潰.通用的異常捕獲機制將證明非常有用.

                  I am trying to debug Java/jni code that calls native windows functions and the virtual machine keeps crashing. The native code appears fine in unit testing and only seems to crash when called through jni. A generic exception catching mechanism would prove extremely useful.

                  推薦答案

                  try{
                      // ...
                  } catch (...) {
                      // ...
                  }
                  

                  將捕獲所有 C++ 異常,但它應該被認為是糟糕的設計.您可以使用 c++11 的新 current_exception 機制,但是如果您沒有能力使用 c++11(需要重寫的遺留代碼系統),那么您就沒有用于獲取消息或名稱的命名異常指針.您可能希望為您可以捕獲的各種異常添加單獨的 catch 子句,并且只捕獲底部的所有內容以記錄意外異常.例如:

                  will catch all C++ exceptions, but it should be considered bad design. You can use c++11's new current_exception mechanism, but if you don't have the ability to use c++11 (legacy code systems requiring a rewrite), then you have no named exception pointer to use to get a message or name. You may want to add separate catch clauses for the various exceptions you can catch, and only catch everything at the bottom to record an unexpected exception. E.g.:

                  try{
                      // ...
                  } catch (const std::exception& ex) {
                      // ...
                  } catch (const std::string& ex) {
                      // ...
                  } catch (...) {
                      // ...
                  }
                  

                  這篇關于C++ 捕獲所有異常的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                  Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                  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 之間的區別)
                  • <bdo id='CBK0V'></bdo><ul id='CBK0V'></ul>

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

                        <tbody id='CBK0V'></tbody>

                      <tfoot id='CBK0V'></tfoot>

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

                            <i id='CBK0V'><tr id='CBK0V'><dt id='CBK0V'><q id='CBK0V'><span id='CBK0V'><b id='CBK0V'><form id='CBK0V'><ins id='CBK0V'></ins><ul id='CBK0V'></ul><sub id='CBK0V'></sub></form><legend id='CBK0V'></legend><bdo id='CBK0V'><pre id='CBK0V'><center id='CBK0V'></center></pre></bdo></b><th id='CBK0V'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='CBK0V'><tfoot id='CBK0V'></tfoot><dl id='CBK0V'><fieldset id='CBK0V'></fieldset></dl></div>
                          1. 主站蜘蛛池模板: 亚洲在线视频观看 | 日韩精品视频一区二区三区 | 亚洲一区二区免费视频 | 日韩精品视频在线免费观看 | 中文字幕在线观看网站 | 美女黄色大片 | 久久久精品 | 国产午夜小视频 | 特大黑人巨交吊性xxxx视频 | 久久久成人免费视频 | 亚洲17p| 一区在线观看视频 | 国产精品96 | 日韩精品在线一区 | 久草视频在线播放 | 欧美成年人视频 | 国产人成一区二区三区影院 | 天天澡天天狠天天天做 | 国产香蕉av | 免费看av的网址 | 欧美成年人视频 | 国产一区欧美 | 中文字幕综合 | 午夜精品视频在线 | 午夜在线视频观看 | 成人一级视频 | 日韩欧美精品一区二区 | 日韩一区二区在线播放 | 日韩在线中文 | 久久久在线 | 午夜伦理福利 | 欧美在线不卡 | 亚洲免费大片 | 天天干天天操天天射 | 日韩一二区 | 中国av在线播放 | 国产日韩视频 | 视频在线一区 | 91爱爱爱| 黄色小说视频网站 | 91视频亚洲 |