Author: zhaohongchao Date: Wed May 6 03:18:23 2009 New Revision: 244 Modified: trunk/libs/exception/doc/current_exception.html trunk/libs/exception/doc/exception_cloning_hpp.html trunk/libs/exception/doc/exception_destructor.html trunk/libs/exception/doc/exception_enable_error_info_hpp.html trunk/libs/exception/doc/exception_error_info_group_hpp.html trunk/libs/exception/doc/exception_error_info_hpp.html trunk/libs/exception/doc/exception_error_info_value_hpp.html trunk/libs/exception/doc/exception_exception_hpp.html trunk/libs/exception/doc/exception_hpp.html trunk/libs/exception/doc/exception_ptr.html trunk/libs/exception/doc/reno.css trunk/libs/exception/doc/rethrow_exception.html trunk/libs/exception/doc/throw_exception.html trunk/libs/exception/doc/throw_exception_hpp.html trunk/libs/exception/doc/tutorial_exception_ptr.html trunk/libs/exception/doc/unknown_exception.html Log: Modified: trunk/libs/exception/doc/current_exception.html ============================================================================== --- trunk/libs/exception/doc/current_exception.html (original) +++ trunk/libs/exception/doc/current_exception.html Wed May 6 03:18:23 2009 @@ -27,20 +27,31 @@ {<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>();</span>
}</pre> -</div><h4>Requirements:</h4>-<p>The <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> function must not be called outside of a catch block.</p>
-<h4>Returns:</h4>-<div><ul><li> An <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> that refers to the currently handled exception or a copy of the currently handled exception.</li> -<li> If the function needs to allocate memory and the attempt fails, it returns an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> that refers to an instance of std::bad_alloc.</li>
+</div><h4>要求:</h4>+<p>在catch块的外部不能调用 <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>
+ 函数.</p> +<h4>返回值:</h4>+<div><ul><li> 异常对象指针 <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>
+ ,指向当前处理的异常对象或者其拷贝.</li>+<li> 如果函数需要分配内存,但是分配失败, <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>
+ 对象指向一个 std::bad_alloc 的实例.</li> </ul></div> -<h4>Throws:</h4> -<p>Nothing.</p> -<h4>Notes:</h4>-<div><ul><li> It is unspecified whether the return values of two successive calls to <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> refer to the same exception object.</li> -<li> Correct implementation of <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> may require compiler support, unless <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> was used at the time the currently handled exception object was passed to throw. If <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> was not used, and if the compiler does not provide the necessary support, then <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> may return an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> that refers to an instance of <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>. In this case, if the original exception object derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, then the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> sub-object of the <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span> object is initialized by the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> copy constructor.</li>
+<h4>异常抛出:</h4> +<p>没有.</p> +<h4>注意:</h4>+<div><ul><li> 两次连续的调用函数 <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>
+ ,并不保证总是指向同一的异常对象.</li>+<li> 在需要抛出当前要处理的异常的时候,除非调用了函数<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>, + 否则函数 <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> + 的实现可能需要编译器的支持. 如果没有调用函数 <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> , + 而且编译器没有提供必要的支持,那么函数 <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> + 可能返回一个指向<span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>类型的异常对象指 针. + 在这种情况下, 如果初始的异常对象是从 boost::<span class="RenoLink"><a href="exception.html">exception</a></span>继承而来, + 那么通过boost::<span class="RenoLink"><a href="exception.html">exception</a></span> s的copy构造函数, <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>
+ 类型的子对象就会被构造出来.</li> </ul></div> </div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> -<h3>See Also:</h3> +<h3>参见:</h3><div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp<br/> </a><a href="copy_exception.html">copy_exception<br/> Modified: trunk/libs/exception/doc/exception_cloning_hpp.html ============================================================================== --- trunk/libs/exception/doc/exception_cloning_hpp.html (original)+++ trunk/libs/exception/doc/exception_cloning_hpp.html Wed May 6 03:18:23 2009
@@ -45,7 +45,7 @@<span class="RenoIncludeSPAN">void <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const & ep );</span></span>
}</pre> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> -<h3>See Also:</h3> +<h3>参见:</h3><div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="exception_hpp.html">boost/exception.hpp<br/> </a><a href="copy_exception.html">copy_exception<br/> Modified: trunk/libs/exception/doc/exception_destructor.html ============================================================================== --- trunk/libs/exception/doc/exception_destructor.html (original)+++ trunk/libs/exception/doc/exception_destructor.html Wed May 6 03:18:23 2009
@@ -22,12 +22,13 @@<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>exception::~exception</h3>
</div><div class="RenoIncludeDIV"><pre><span class="RenoLink"><a href="exception_destructor.html">~exception</a></span>();</pre>
-</div><h4>Effects:</h4>-<p>Frees all resources associated with a boost::<span class="RenoLink"><a href="exception.html">exception</a></span> object.</p>
-<h4>Throws:</h4> -<p>Nothing.</p> +</div><h4>效果:</h4>+<p>释放和对象 boost::<span class="RenoLink"><a href="exception.html">exception</a></span>
+ 关联的所有资源.</p> +<h4>异常抛出:</h4> +<p>没有.</p> </div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> -<h3>See Also:</h3> +<h3>参见:</h3> <div class="RenoPageList"><a href="exception.html">exception<br/> </a></div> </div> Modified: trunk/libs/exception/doc/exception_enable_error_info_hpp.html ============================================================================== --- trunk/libs/exception/doc/exception_enable_error_info_hpp.html (original)+++ trunk/libs/exception/doc/exception_enable_error_info_hpp.html Wed May 6 03:18:23 2009
@@ -31,7 +31,7 @@---unspecified--- <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>( T const & x );</span></span>
}</pre> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> -<h3>See Also:</h3> +<h3>参见:</h3><div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="enable_error_info.html">enable_error_info<br/> </a></div> Modified: trunk/libs/exception/doc/exception_error_info_group_hpp.html ============================================================================== --- trunk/libs/exception/doc/exception_error_info_group_hpp.html (original)+++ trunk/libs/exception/doc/exception_error_info_group_hpp.html Wed May 6 03:18:23 2009
@@ -35,7 +35,7 @@<span class="RenoLink"><a href="error_info.html">error_info</a></span><TagN,TN> > const & v );</span></span>
}</pre> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> -<h3>See Also:</h3> +<h3>参见:</h3><div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="exception_hpp.html">boost/exception.hpp<br/> </a><a href="tuple_operator_shl.html">tuple/operator<<<br/> Modified: trunk/libs/exception/doc/exception_error_info_hpp.html ============================================================================== --- trunk/libs/exception/doc/exception_error_info_hpp.html (original)+++ trunk/libs/exception/doc/exception_error_info_hpp.html Wed May 6 03:18:23 2009
@@ -45,7 +45,7 @@E const & <span class="RenoLink"><a href="exception_operator_shl.html">operator<<</a></span>( E const & x, <span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag,T> const & v );</span></span>
}</pre> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> -<h3>See Also:</h3> +<h3>参见:</h3><div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="exception_hpp.html">boost/exception.hpp<br/> </a><a href="error_info.html">error_info<br/> Modified: trunk/libs/exception/doc/exception_error_info_value_hpp.html ============================================================================== --- trunk/libs/exception/doc/exception_error_info_value_hpp.html (original)+++ trunk/libs/exception/doc/exception_error_info_value_hpp.html Wed May 6 03:18:23 2009
@@ -29,7 +29,7 @@class <span class="RenoLink"><a href="error_info.html">error_info</a></span>;</span></span>
}</pre> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> -<h3>See Also:</h3> +<h3>参见:</h3><div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="exception_hpp.html">boost/exception.hpp<br/> </a><a href="error_info.html">error_info<br/> Modified: trunk/libs/exception/doc/exception_exception_hpp.html ============================================================================== --- trunk/libs/exception/doc/exception_exception_hpp.html (original)+++ trunk/libs/exception/doc/exception_exception_hpp.html Wed May 6 03:18:23 2009
@@ -43,7 +43,7 @@typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_throw_line,int> throw_line;</span>
}</pre> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> -<h3>See Also:</h3> +<h3>参见:</h3><div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>
</a><a href="boost-exception.html">Boost Exception<br/> </a><a href="exception_hpp.html">boost/exception.hpp<br/> Modified: trunk/libs/exception/doc/exception_hpp.html ============================================================================== --- trunk/libs/exception/doc/exception_hpp.html (original) +++ trunk/libs/exception/doc/exception_hpp.html Wed May 6 03:18:23 2009 @@ -30,7 +30,7 @@#include <<span class="RenoLink"><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></span>> #include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>></span></pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> -<h3>See Also:</h3> +<h3>参见:</h3><div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> </a><a href="tutorial_diagnostic_information.html">Diagnostic Information<br/> </a><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies<br/>
Modified: trunk/libs/exception/doc/exception_ptr.html ============================================================================== --- trunk/libs/exception/doc/exception_ptr.html (original) +++ trunk/libs/exception/doc/exception_ptr.html Wed May 6 03:18:23 2009 @@ -27,17 +27,21 @@ {<span class="RenoIncludeSPAN"> typedef ---unspecified--- <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>;</span>
}</pre>-</div><p>The <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> type can be used to refer to a copy of an exception object. It is Default Constructible, Copy Constructible, Assignable and Equality Comparable; <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>'s operations do not throw.</p> -<p>Two instances of <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> are equivalent and compare equal if and only if they refer to the same exception.</p> -<p>The default constructor of <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> produces the null value of the type. The null value is equivalent only to itself.</p> +</div><p><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> + 类型用来指向异常对象的拷贝. 它符合 Default Constructible, Copy Constructible, Assignable 和 Equality Comparable + 概念的要求; <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>
+ 类型的操作部抛出异常.</p>+<p> <span class="RenoLink"><a href="exception_ptr.html">exception_ptran> are equ
+ 类型的实例被认为是相等的,当且仅当它们指向同一个异常对象.</p>+<p> <span class="RenoLink"><a href="exception_ptr.html">exception_ptran> produce
+ 的没人构造函数初始化一个 null 值的对象, 并且只是和自身相等.</p> <h4>Thread safety</h4><div><ul><li> It is legal for multiple threads to hold <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> references to the same exception object.</li> <li> It is illegal for multiple threads to modify the same <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> object concurrently.</li> <li> While calling <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> makes a copy of the current exception object, it is still possible for the two copies to share internal state. Therefore, in general it is not safe to call <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span> concurrently to throw the same exception object into multiple threads.</li>
</ul></div> </div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> -<h3>See Also:</h3>-<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> +<h3>参见:div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp<br/> </a><a href="copy_exception.html">copy_exception<br/> </a><a href="current_exception.html">current_exception<br/> Modified: trunk/libs/exception/doc/reno.css ============================================================================== --- trunk/libs/exception/doc/reno.css (original) +++ trunk/libs/exception/doc/reno.css Wed May 6 03:18:23 2009 @@ -66,6 +66,7 @@ margin-top: 0; margin-bottom: 0; margin-right: 4pt; + height: 23px; } p Modified: trunk/libs/exception/doc/rethrow_exception.html ============================================================================== --- trunk/libs/exception/doc/rethrow_exception.html (original) +++ trunk/libs/exception/doc/rethrow_exception.html Wed May 6 03:18:23 2009 @@ -27,12 +27,12 @@ {<span class="RenoIncludeSPAN"> void <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const & ep );</span>
}</pre> -</div><h4>Precondition:</h4> -<p>ep shall not be null.</p> -<h4>Throws:</h4> -<p>The exception to which ep refers.</p> +</div><h4>前置条件:</h4> +<p>ep 不能是 null.</p> +<h4>异常抛出:</h4> +<p> ep 对应的异常.</p> </div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> -<h3>See Also:</h3> +<h3>参见:</h3><div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp<br/> </a><a href="exception_ptr.html">exception_ptr<br/> Modified: trunk/libs/exception/doc/throw_exception.html ============================================================================== --- trunk/libs/exception/doc/throw_exception.html (original) +++ trunk/libs/exception/doc/throw_exception.html Wed May 6 03:18:23 2009 @@ -32,14 +32,18 @@void <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( E const & e );
#endif</span> }</pre> -</div><h4>Requirements:</h4> -<p>E must derive publicly from std::exception.</p> -<h4>Effects:</h4>-<div><ul><li> If BOOST_NO_EXCEPTIONS is not defined, boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(e) is equivalent to throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(e) is equivalent to throw e;</li> -<li> If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> are allowed to assume that the function never returns; therefore, if the user-defined <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> returns, the behavior is undefined.</li>
+</div><h4>要求:</h4> +<p>E 必须从std::exception共有继承.</p> +<h4>效果:</h4>+<div><ul><li> 如果 BOOST_NO_EXCEPTIONS 没有定义, boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(e) + 和 throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(e))等效, + 除非宏 BOOST_EXCEPTION_DISABLE 被定义, 这样boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(e)
+ 等效于 throw e;</li>+<li> 如果 BOOST_NO_EXCEPTIONS 被定义, 这个函数被遗留, 那么用户应该提供一个 适当的实现. 调用函数 <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> + ,可以适当的假定函数永不返回; 因此,如果函数返回了,那么结果是未定义 的.</li>
</ul></div> </div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> -<h3>See Also:</h3> +<h3>参见:</h3><div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>
</a><a href="boost-exception.html">Boost Exception<br/> </a><a href="throw_exception_hpp.html">boost/throw_exception.hpp<br/> Modified: trunk/libs/exception/doc/throw_exception_hpp.html ============================================================================== --- trunk/libs/exception/doc/throw_exception_hpp.html (original)+++ trunk/libs/exception/doc/throw_exception_hpp.html Wed May 6 03:18:23 2009
@@ -45,7 +45,7 @@ #endif</span> }</pre> </div></div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> -<h3>See Also:</h3> +<h3>参见:</h3><div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>
</a><a href="boost-exception.html">Boost Exception<br/> </a><a href="configuration_macros.html">Configuration Macros<br/> Modified: trunk/libs/exception/doc/tutorial_exception_ptr.html ============================================================================== --- trunk/libs/exception/doc/tutorial_exception_ptr.html (original)+++ trunk/libs/exception/doc/tutorial_exception_ptr.html Wed May 6 03:18:23 2009
@@ -3,7 +3,7 @@ <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'> <head> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/> - <title>transporting of exceptions between threads</title> + <title>线程之间传递异常</title> <link href='reno.css' type='text/css' rel='stylesheet'/> </head> <body> @@ -19,14 +19,14 @@ <!-- Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. --><!-- Distributed under the Boost Software License, Version 1.0. (See accompanying --> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> -<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Transporting of Exceptions Between Threads</h2> +<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>线程之间传递异常 </h2>
</div>-<p>Boost Exception supports transporting of exception objects between threads through cloning. This system is similar to <span class="RenoLink"><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html";>N2179</a></span>, but because Boost Exception can not rely on language support, the use of <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> at the time of the throw is required in order to use cloning.</p>
-<h4>Note:</h4>-<p>All exceptions emitted by the familiar function boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> are guaranteed to derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> and to support cloning.</p> -<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Using enable_current_exception at the Time of the Throw</h3> +<p>Boost 异常通过clone 支持线程之间的异常传递. 这跟 <span class="RenoLink"><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html";>N2179</a></span>是 相似的, 但是因为 Boost 异常不能仅仅依赖于语言的支持, 这就需要在抛出异常的时 候使用函数 <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> 对 异常对象进行clone.</p>
+<h4>注意:</h4>+<p>所有通过函数 boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> 抛出的异常都是从 boost::<span class="RenoLink"><a href="exception.html">exception</a></span> 继承的,并且支持clone.</p> +<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>抛出异常的时候使 用 enable_current_exception </h3>
</div> -<p>Here is how cloning can be enabled in a throw-expression (15.1):</p> +<p>下面的例子说明如何在throw语句中支持clone (15.1):</p><pre>#include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>>
#include <stdio.h> #include <errno.h> @@ -42,10 +42,10 @@throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(file_read_error()) <<
errno_info(errno); }</pre>-<p>Of course, <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> may be used with any exception type; there is no requirement that it should derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p> -</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Cloning and Re-Throwing an Exception</h3> +<p>当然, 函数<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> 支 持任何的异常类型,没有要求说异常类型一定要从boost::<span class="RenoLink"><a href="exception.html">exception</a></span>继承.</p> +</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>clone并再次 抛出异常对象</h3>
</div>-<p>When you catch an exception, you can call <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> to get an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> object:</p> +<p>当你捕获异常对象, 你可以通过函数 <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> 得到 <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> 得到 它:</p> <pre>#include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>>
#include <boost/thread.hpp> #include <boost/bind.hpp> @@ -66,7 +66,7 @@error = boost::<span class="RenoLink"><a href="current_exception.html">current_exception</a></span>();
} }</pre>-<p>In the above example, note that <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> captures the original type of the exception object. The exception can be thrown again using the <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span> function:</p> +<p>在上面的实例中, 注意 <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> 捕获的是原始类型 的异常对象, 并且可以通过函数 <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span> 重新抛出:</p>
<pre>// ...continued void @@ -78,13 +78,13 @@ if( error )boost::<span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span>(error);
}</pre>-<p>Note that <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> could fail to copy the original exception object in the following cases:</p> -<div><ul><li> if there is not enough memory, in which case the returned <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> points to an instance of std::bad_alloc, or</li> -<li> if <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> was not used in the throw-expression passed to the original throw statement and the current implementation does not have the necessary compiler-specific support to copy the exception automatically, in which case the returned <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> points to an instance of <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>.</li> +<p>注意函数 <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> 会在下面的情形中 导致不能拷贝原始的异常对象 :</p> +<div><ul><li> 没有足够的空间, 在那种情况下指针 <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> 指向std std::bad_alloc类 型的异常, 或者</li> +<li> 如果在throw 语句中没有使用函数 <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> ,并 且当前的编译器不支持自动拷贝异常对象, 那么得到的指针<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> 指向 <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>类型的对象.</li>
</ul></div>-<p>Regardless, the use of <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> and <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span> in the above examples is well-formed.</p> +<p>无论如何, 在上面的实例中,函数 <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> 和 <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span> 的使用在形式上都 是合法的.</p>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> -<h3>See Also:</h3> +<h3>参见:</h3><div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a></div> </div> Modified: trunk/libs/exception/doc/unknown_exception.html ============================================================================== --- trunk/libs/exception/doc/unknown_exception.html (original) +++ trunk/libs/exception/doc/unknown_exception.html Wed May 6 03:18:23 2009 @@ -33,9 +33,10 @@ ---unspecified--- };</span> }</pre>-</div><p>This type is used by the <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> support in Boost Exception. Please see <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>.</p> +</div><p>这个类型被 <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> + 使用,参见 <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>.</p>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> -<h3>See Also:</h3> +<h3>参见:</h3><div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp<br/> </a><a href="current_exception.html">current_exception<br/>