Files
hustoj/web/cppreference-zh/chmhelp/cpp-error-bad_exception-bad_exception.html
2025-08-01 12:57:54 +08:00

87 lines
4.6 KiB
HTML

<!DOCTYPE html>
<html lang="zh" dir="ltr" class="client-nojs" xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh">
<head><meta http-equiv="x-ua-compatible" content="ie=edge">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>std::bad_exception::bad_exception</title>
<link rel="stylesheet" href="ext.css" />
<link rel="stylesheet" href="site_modules.css" />
</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-cpp_error_bad_exception_bad_exception skin-cppreference2 action-view cpp-navbar">
<div id="cpp-content-base">
<div id="content"><a id="top"></a>
<h1 id="firstHeading" class="firstHeading"><span style="font-size:0.7em; line-height:130%">std::bad_exception::</span>bad_exception</h1>
<div id="bodyContent">
<div id="contentSub"><span class="subpages">&lt; <a href="cpp.html">cpp</a>&lrm; | <a href="cpp-error.html">error</a>&lrm; | <a href="cpp-error-bad_exception.html">bad exception</a></span></div>
<div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr" xml:lang="zh">
<table class="t-dcl-begin">
<tbody></tbody>
<tbody class="t-dcl-rev t-dcl-rev-num">
<tr class="t-dcl-rev-aux">
<td></td>
<td rowspan="142">(1)</td>
<td></td>
</tr>
<tr class="t-dcl t-until-cxx11">
<td>
<div><span class="mw-geshi cpp source-cpp">bad_exception<span class="br0">(</span><span class="br0">)</span> <span class="kw1">throw</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span></span></div>
</td>
<td class="t-dcl-nopad"></td>
<td><span class="t-mark-rev t-until-cxx11">(C++11 &#21069;)</span></td>
</tr>
<tr class="t-dcl t-since-cxx11">
<td>
<div><span class="mw-geshi cpp source-cpp">bad_exception<span class="br0">(</span><span class="br0">)</span> <span class="kw1">noexcept</span><span class="sy4">;</span></span></div>
</td>
<td class="t-dcl-nopad"></td>
<td><span class="t-mark-rev t-since-cxx11">(C++11 &#36215;)</span></td>
</tr>
</tbody>
<tbody></tbody>
<tbody class="t-dcl-rev t-dcl-rev-num">
<tr class="t-dcl-rev-aux">
<td></td>
<td rowspan="142">(2)</td>
<td></td>
</tr>
<tr class="t-dcl t-until-cxx11">
<td>
<div><span class="mw-geshi cpp source-cpp">bad_exception<span class="br0">(</span> <span class="kw4">const</span> bad_exception<span class="sy3">&amp;</span> other <span class="br0">)</span> <span class="kw1">throw</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span></span></div>
</td>
<td class="t-dcl-nopad"></td>
<td><span class="t-mark-rev t-until-cxx11">(C++11 &#21069;)</span></td>
</tr>
<tr class="t-dcl t-since-cxx11">
<td>
<div><span class="mw-geshi cpp source-cpp">bad_exception<span class="br0">(</span> <span class="kw4">const</span> bad_exception<span class="sy3">&amp;</span> other <span class="br0">)</span> <span class="kw1">noexcept</span><span class="sy4">;</span></span></div>
</td>
<td class="t-dcl-nopad"></td>
<td><span class="t-mark-rev t-since-cxx11">(C++11 &#36215;)</span></td>
</tr>
</tbody>
<tbody>
<tr class="t-dcl-sep">
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>&#26500;&#36896;&#26032;&#30340; <code>bad_exception</code> &#23545;&#35937;&#12290;</p>
<div class="t-li1"><span class="t-li">1)</span> &#40664;&#35748;&#26500;&#36896;&#20989;&#25968;&#12290; <span class="t-c"><span class="mw-geshi cpp source-cpp">what<span class="br0">(</span><span class="br0">)</span></span></span> &#36820;&#22238;&#23454;&#29616;&#23450;&#20041;&#30340;&#23383;&#31526;&#20018;&#12290;</div>
<div class="t-li1"><span class="t-li">2)</span> &#22797;&#21046;&#26500;&#36896;&#20989;&#25968;&#12290;&#20197; <code>other</code> &#30340;&#20869;&#23481;&#21021;&#22987;&#21270;&#23545;&#35937;&#12290;<span class="t-rev-inl t-since-cxx11"><span>&#33509; <code>*this</code> &#19982; <code>other</code> &#22343;&#25317;&#26377;&#21160;&#24577;&#31867;&#22411; <code>std::bad_exception</code> &#65292;&#21017; <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="cpp-string-byte-strcmp.html"><span class="kw1146">std::<span class="me2">strcmp</span></span></a><span class="br0">(</span>what<span class="br0">(</span><span class="br0">)</span>, other.<span class="me1">what</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span> <span class="sy1">==</span> <span class="nu0">0</span></span></span> &#12290;</span> <span><span class="t-mark-rev t-since-cxx11">(C++11 &#36215;)</span></span></span></div>
<h3><span class="mw-headline" id=".E5.8F.82.E6.95.B0">&#21442;&#25968;</span></h3>
<table class="t-par-begin">
<tr class="t-par">
<td>other</td>
<td>-</td>
<td>&#35201;&#20197;&#20043;&#21021;&#22987;&#21270;&#30340; <code>bad_exception</code> &#23545;&#35937;</td>
</tr>
</table>
</div>
<div class="visualClear"></div>
</div>
</div>
</div>
</body>
</html>