6868
6969 </head>
7070 <body>
71- <header data-kunai-mdinfo="{"meta": {"header": ["exception"], "namespace": ["std"], "id-type": ["function"], "cpp": ["cpp11"]}, "sources": [{"id": "e1e59a5e312014012689b354736652204fad1965 ", "source": "#include <iostream>\n#include <exception>\n#include <stdexcept>\n\nint main()\n{\n std::exception_ptr ep;\n\n try {\n throw std::runtime_error(\"error!\");\n }\n catch (...) {\n std::cout << \"catch\" << std::endl;\n ep = std::current_exception(); // \u51e6\u7406\u4e2d\u306e\u4f8b\u5916\u30dd\u30a4\u30f3\u30bf\u3092\u53d6\u5f97\n }\n\n if (ep) {\n std::cout << \"rethrow\" << std::endl;\n std::rethrow_exception(ep); // \u518d\u30b9\u30ed\u30fc \n }\n}\n"}], "page_id": ["reference", "exception", "current_exception"]}">
71+ <header data-kunai-mdinfo="{"meta": {"header": ["exception"], "namespace": ["std"], "id-type": ["function"], "cpp": ["cpp11"]}, "sources": [{"id": "b23f7da7b16ee3f1a9928d3acf9c1a87de27e39c ", "source": "#include <iostream>\n#include <exception>\n#include <stdexcept>\n\nint main()\n{\n std::exception_ptr ep;\n\n try {\n throw std::runtime_error(\"error!\");\n }\n catch (...) {\n std::cout << \"catch\" << std::endl;\n ep = std::current_exception(); // \u51e6\u7406\u4e2d\u306e\u4f8b\u5916\u30dd\u30a4\u30f3\u30bf\u3092\u53d6\u5f97\n }\n\n if (ep) {\n std::cout << \"rethrow\" << std::endl;\n std::rethrow_exception(ep); // \u518d\u9001\u51fa \n }\n}\n"}], "page_id": ["reference", "exception", "current_exception"]}">
7272 <nav class="navbar navbar-default" role="navigation">
7373 <div class="container-fluid">
7474 <div class="navbar-header">
188188
189189 <p class="text-right"><small>
190190 最終更新日時(UTC):
191- <span itemprop="datePublished" content="2025-07-11T17:16:44 ">
192- 2025年07月11日 17時16分44秒
191+ <span itemprop="datePublished" content="2026-01-06T03:47:59 ">
192+ 2026年01月06日 03時47分59秒
193193 </span>
194194 <br/>
195195 <span itemprop="author" itemscope itemtype="http://schema.org/Person">
@@ -238,7 +238,7 @@ <h2>備考</h2>
238238<p>この関数は、<code>catch</code>節で使用すれば、処理中の<a class="cpprefjp-defined-word" data-desc="問題が発生したときに、現在実行位置を過去に通過・記録した位置に戻し、文脈情報を添えて紐づけられた処理(例外ハンドラー)を呼び出す仕組み。またはその事態">例外</a>オブジェクトへの<a class="cpprefjp-defined-word" data-desc="問題が発生したときに、現在実行位置を過去に通過・記録した位置に戻し、文脈情報を添えて紐づけられた処理(例外ハンドラー)を呼び出す仕組み。またはその事態">例外</a>ポインタを取得できる。</p>
239239<p>ただし、<a class="cpprefjp-defined-word" data-desc="問題が発生したときに、現在実行位置を過去に通過・記録した位置に戻し、文脈情報を添えて紐づけられた処理(例外ハンドラー)を呼び出す仕組み。またはその事態">例外</a>送出によるスタック巻き戻し中は、取得できないので注意。(スタック巻き戻し中とは、<code>try</code>ブロック中で定義されたオブジェクトのデストラクタのこと)</p>
240240<h2>例</h2>
241- <p><div class="yata" id="e1e59a5e312014012689b354736652204fad1965 "><div class="codehilite"><pre><span></span><code><span class="cp">#include</span> <span class="cpf"><a href="../iostream.html"><iostream></a></span><span class="cp"></span>
241+ <p><div class="yata" id="b23f7da7b16ee3f1a9928d3acf9c1a87de27e39c "><div class="codehilite"><pre><span></span><code><span class="cp">#include</span> <span class="cpf"><a href="../iostream.html"><iostream></a></span><span class="cp"></span>
242242<span class="cp">#include</span> <span class="cpf"><a href="../exception.html"><exception></a></span><span class="cp"></span>
243243<span class="cp">#include</span> <span class="cpf"><a href="../stdexcept.html"><stdexcept></a></span><span class="cp"></span>
244244
@@ -256,7 +256,7 @@ <h2>例</h2>
256256
257257 <span class="k">if</span> <span class="p">(</span><span class="n">ep</span><span class="p">)</span> <span class="p">{</span>
258258 <span class="n"><a href="../iostream/cout.html">std::cout</a></span> <span class="o"><<</span> <span class="s">"rethrow"</span> <span class="o"><<</span> <span class="n"><a href="../ostream/endl.html">std::endl</a></span><span class="p">;</span>
259- <span class="n"><a href="rethrow_exception.html">std::rethrow_exception</a></span><span class="p">(</span><span class="n">ep</span><span class="p">);</span> <span class="c1">// 再スロー </span>
259+ <span class="n"><a href="rethrow_exception.html">std::rethrow_exception</a></span><span class="p">(</span><span class="n">ep</span><span class="p">);</span> <span class="c1">// 再送出 </span>
260260 <span class="p">}</span>
261261<span class="p">}</span>
262262</code></pre></div>
0 commit comments