[boost-doc-zh commit] r233 - 完成 scope_exit 库文档翻译

  • From: codesite-noreply@xxxxxxxxxx
  • To: boost-doc-zh-notify@xxxxxxxxxxxxx
  • Date: Wed, 01 Apr 2009 12:36:44 +0000

Author: alai04
Date: Wed Apr  1 03:09:45 2009
New Revision: 233

Added:
   trunk/libs/scope_exit/example/
   trunk/libs/scope_exit/example/world.cpp
Modified:
   trunk/libs/libraries.htm
   trunk/libs/scope_exit/doc/html/index.html
   trunk/libs/scope_exit/doc/html/scope_exit/acknowledge.html
   trunk/libs/scope_exit/doc/html/scope_exit/alternatives.html
   trunk/libs/scope_exit/doc/html/scope_exit/compilers.html
   trunk/libs/scope_exit/doc/html/scope_exit/conf.html
   trunk/libs/scope_exit/doc/html/scope_exit/ref.html
   trunk/libs/scope_exit/doc/html/scope_exit/tutorial.html

Log:
完成 scope_exit 库文档翻译

Modified: trunk/libs/libraries.htm
==============================================================================
--- trunk/libs/libraries.htm    (original)
+++ trunk/libs/libraries.htm    Wed Apr  1 03:09:45 2009
@@ -640,7 +640,7 @@
<a href="config/config.htm">config</a>, <a href="conversion/index.html">conversion</a>, <a href="date_time/doc/index.html">date_time</a>, <a href="filesystem/doc/index.htm">filesystem</a>, <a href="foreach/index.html">foreach</a>,&nbsp;<a href="function_types/index.html">function_types</a>, <a href="functional/index.html">functional</a>, <a href="integer/index.html">integer</a>, <a href="intrusive/index.html">intrusive</a>, <a href="io/doc/ios_state.html">io state savers</a>, <a href="iostreams/doc/index.html">iostreams</a>, <a href="iterator/doc/index.html">iterators</a>, <a href="algorithm/minmax/index.html">minmax</a>, <a href="mpl/doc/index.html">mpl</a>, <a href="multi_array/doc/index.html">multi_array</a>, <a href="multi_index/doc/index.html">multi_index</a>, <a href="numeric/conversion/doc/html/index.html">numeric/conversion</a>, <a href="utility/operators.htm">operators</a>, <a href="optional/doc/html/index.html">optional</a>, <a href="ptr_container/index.html">pointer container</a>, <a href="preprocessor/doc/index.html">preprocessor</a>, <a href="../doc/html/program_options.html">program_options</a>, <a href="property_map/property_map.html">property map</a>, <a href="proto/index.html">proto</a>, -<a href="range/index.html">range</a>, <a href="rational/index.html">rational</a>, <a href="serialization/doc/index.html">serialization</a>, +<a href="range/index.html">range</a>, <a href="rational/index.html">rational</a>, <a href="scope_exit/doc/html/index.html">scope_exit</a>, <a href="serialization/doc/index.html">serialization</a>, <a href="statechart/doc/index.html">statechart</a>, <a href="utility/swap.html">swap</a>, <a href="system/doc/index.html">system</a>, <a href="tokenizer/index.html">tokenizer</a>, <a href="tr1/index.html">TR1</a>, <a href="../doc/html/tribool.html">tribool</a>, <a href="../doc/html/unordered.html">unordered</a>, <a href="utility/utility.htm">utility</a>, <a href="utility/value_init.htm">value_initialized</a>, <a href="variant/index.html">variant</a>,&nbsp;<a href="wave/index.html">wave</a> 以及 <a href="../doc/html/tools.html">Boost Tools</a>&nbsp; </p>
 <p>fatalerror99:<a href="array/index.html">array</a>,
<a href="bind/bind.html">bind</a> and <a href="bind/mem_fn.html">mem_fn</a>, <a href="dynamic_bitset/dynamic_bitset.html">dynamic_bitset</a>,

Modified: trunk/libs/scope_exit/doc/html/index.html
==============================================================================
--- trunk/libs/scope_exit/doc/html/index.html   (original)
+++ trunk/libs/scope_exit/doc/html/index.html   Wed Apr  1 03:09:45 2009
@@ -1,31 +1,30 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Chapter 1. Boost.ScopeExit</title>
-<link rel="stylesheet" href="../../../../doc/html/boostbook.css" type="text/css">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+
+<title>Chapter&nbsp;1.&nbsp;Boost.ScopeExit</title><link rel="stylesheet" href="../../../../doc/html/boostbook.css" type="text/css">
 <meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
-<link rel="home" href="index.html" title="Chapter 1. Boost.ScopeExit">
-<link rel="next" href="scope_exit/tutorial.html" title="Tutorial">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>
-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td> +<link rel="home" href="index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">
+<link rel="next" href="scope_exit/tutorial.html" title="Tutorial"></head>
+<body alink="#0000ff" bgcolor="white" link="#0000ff" text="black" vlink="#840084">
+<table cellpadding="2" width="100%"><tbody><tr>
+<td valign="top"><img alt="Boost C++ Libraries" src="../../../../boost.png" height="86" width="277"></td>
 <td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
 <td align="center"><a href="../../../../more/index.htm">More</a></td>
-</tr></table>
+</tr></tbody></table>
 <hr>
<div class="spirit-nav"><a accesskey="n" href="scope_exit/tutorial.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a></div>
 <div class="chapter" lang="en">
 <div class="titlepage"><div>
 <div><h2 class="title">
-<a name="scope_exit"></a>Chapter 1. Boost.ScopeExit</h2></div>
+<a name="scope_exit"></a>Chapter&nbsp;1.&nbsp;Boost.ScopeExit</h2></div>
 <div><div class="author"><h3 class="author">
<span class="firstname">Alexander</span> <span class="surname">Nasonov</span>
 </h3></div></div>
-<div><p class="copyright">Copyright 2006 -2009 Alexander Nasonov</p></div> +<div><p class="copyright">Copyright (c) 2006 -2009 Alexander Nasonov</p></div>
 <div><div class="legalnotice">
 <a name="id1036342"></a><p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -35,43 +34,43 @@
 </div></div>
 </div></div>
 <div class="toc">
-<p><b>Table of Contents</b></p>
+<p><b>Table of Contents 目录</b></p>
 <dl>
-<dt><span class="section"><a href="index.html#scope_exit.intro"> Introduction</a></span></dt> -<dt><span class="section"><a href="scope_exit/tutorial.html"> Tutorial</a></span></dt> -<dt><span class="section"><a href="scope_exit/alternatives.html"> Alternatives</a></span></dt> -<dt><span class="section"><a href="scope_exit/compilers.html"> Supported Compilers</a></span></dt> -<dt><span class="section"><a href="scope_exit/conf.html"> Configuration</a></span></dt> -<dt><span class="section"><a href="scope_exit/ref.html"> Reference</a></span></dt> -<dt><span class="section"><a href="scope_exit/acknowledge.html"> Acknowledge</a></span></dt> +<dt><span class="section"><a href="index.html#scope_exit.intro"> Introduction 简介</a></span></dt> +<dt><span class="section"><a href="scope_exit/tutorial.html"> Tutorial 教程 </a></span></dt> +<dt><span class="section"><a href="scope_exit/alternatives.html"> Alternatives 其它选择</a></span></dt> +<dt><span class="section"><a href="scope_exit/compilers.html"> Supported Compilers 支持的编译器</a></span></dt> +<dt><span class="section"><a href="scope_exit/conf.html"> Configuration 配 置</a></span></dt> +<dt><span class="section"><a href="scope_exit/ref.html"> Reference 参考 </a></span></dt> +<dt><span class="section"><a href="scope_exit/acknowledge.html"> Acknowledge 鸣谢</a></span></dt>
 </dl>
 </div>
 <div class="section" lang="en">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="scope_exit.intro"></a> Introduction</h2></div></div></div>
+<div class="titlepage"><div><div><h2 class="title" style="clear: both;">
+<a name="scope_exit.intro"></a> Introduction 简介</h2></div></div></div>
 <p>
- Nowadays, every C++ developer is familiar with <a href="http://www.research.att.com/~bs/glossary.html#Gresource-acquisition-is-initialization"; target="_top">RAII</a> + Nowadays, every C++ developer is familiar with <a href="http://www.research.att.com/%7Ebs/glossary.html#Gresource-acquisition-is-initialization"; target="_top">RAII</a> technique. It binds resource acquisition and release to initialization and destruction of a variable that holds the resource. But there are times when
-      writing a special class for such variable is not worth the effort.
+ writing a special class for such variable is not worth the effort.<br>当前,每一个C++开发者都会很熟悉 <a href="http://www.research.att.com/%7Ebs/glossary.html#Gresource-acquisition-is-initialization"; target="_top">RAII</a> + 技术。它将资源的获取及释放绑定至持有该资源的变量的初始化及析构。但 是,有时候为此类变量写一个专用的类是不值得的。
     </p>
 <p>
- This is when <a class="link" href="index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> macro comes into play. + This is when <a class="link" href="file:///E:/Translation/boost_doc/libs/scope_exit/doc/html/index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> macro comes into play. You put resource acquisition directly in your code and next to it you write
-      a code that releases the resource.
+ a code that releases the resource.<br>这正是 <a class="link" href="index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> 宏发挥作用的时候 了。你可以将资源获取直接写入你的代码,并接着编写释放资源的代码。
     </p>
 <p>
Read <a class="link" href="scope_exit/tutorial.html" title="Tutorial">Tutorial</a> to find out how to - write programs with <a class="link" href="index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> or jump straight - to the <a class="link" href="scope_exit/ref.html" title="Reference">Reference</a> section. + write programs with <a class="link" href="file:///E:/Translation/boost_doc/libs/scope_exit/doc/html/index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> or jump straight + to the <a class="link" href="scope_exit/ref.html" title="Reference">Reference</a> section.<br>请阅读 <a class="link" href="scope_exit/tutorial.html" title="Tutorial">教程</a> 以学习如何用 <a class="link" href="index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> 来编写程序,或者 直接跳到 <a class="link" href="scope_exit/ref.html" title="Reference">参考 </a> 一节。
     </p>
 </div>
 </div>
-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tbody><tr> <td align="left"><p><small>Last revised: January 28, 2009 at 15:23:21 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
-</tr></table>
+</tr></tbody></table>
 <hr>
<div class="spirit-nav"><a accesskey="n" href="scope_exit/tutorial.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a></div>
-</body>
-</html>
+</body></html>
\ No newline at end of file

Modified: trunk/libs/scope_exit/doc/html/scope_exit/acknowledge.html
==============================================================================
--- trunk/libs/scope_exit/doc/html/scope_exit/acknowledge.html  (original)
+++ trunk/libs/scope_exit/doc/html/scope_exit/acknowledge.html Wed Apr 1 03:09:45 2009
@@ -1,29 +1,28 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Acknowledge</title>
-<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+
+<title>Acknowledge</title><link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
 <meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
-<link rel="home" href="../index.html" title="Chapter 1. Boost.ScopeExit">
-<link rel="up" href="../index.html" title="Chapter 1. Boost.ScopeExit">
-<link rel="prev" href="ref.html" title="Reference">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>
-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> +<link rel="home" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit"> +<link rel="up" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">
+<link rel="prev" href="ref.html" title="Reference"></head>
+<body alink="#0000ff" bgcolor="white" link="#0000ff" text="black" vlink="#840084">
+<table cellpadding="2" width="100%"><tbody><tr>
+<td valign="top"><img alt="Boost C++ Libraries" src="../../../../../boost.png" height="86" width="277"></td>
 <td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
 <td align="center"><a href="../../../../../more/index.htm">More</a></td>
-</tr></table>
+</tr></tbody></table>
 <hr>
 <div class="spirit-nav">
<a accesskey="p" href="ref.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a>
 </div>
 <div class="section" lang="en">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="scope_exit.acknowledge"></a> Acknowledge</h2></div></div></div>
+<div class="titlepage"><div><div><h2 class="title" style="clear: both;">
+<a name="scope_exit.acknowledge"></a> Acknowledge 鸣谢 </h2></div></div></div>
 <p>
       (in chronological order)
     </p>
@@ -49,18 +48,17 @@
       Richard Webb for testing the library on MSVC compiler.
     </p>
 </div>
-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tbody><tr>
 <td align="left"></td>
-<td align="right"><div class="copyright-footer">Copyright 2006 -2009 Alexander Nasonov<p> +<td align="right"><div class="copyright-footer">Copyright (c) 2006 -2009 Alexander Nasonov<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">
         http://www.boost.org/LICENSE_1_0.txt </a>)
       </p>
 </div></td>
-</tr></table>
+</tr></tbody></table>
 <hr>
 <div class="spirit-nav">
<a accesskey="p" href="ref.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a>
 </div>
-</body>
-</html>
+</body></html>
\ No newline at end of file

Modified: trunk/libs/scope_exit/doc/html/scope_exit/alternatives.html
==============================================================================
--- trunk/libs/scope_exit/doc/html/scope_exit/alternatives.html (original)
+++ trunk/libs/scope_exit/doc/html/scope_exit/alternatives.html Wed Apr 1 03:09:45 2009
@@ -1,30 +1,29 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Alternatives</title>
-<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+
+<title>Alternatives</title><link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
 <meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
-<link rel="home" href="../index.html" title="Chapter 1. Boost.ScopeExit">
-<link rel="up" href="../index.html" title="Chapter 1. Boost.ScopeExit">
+<link rel="home" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit"> +<link rel="up" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">
 <link rel="prev" href="tutorial.html" title="Tutorial">
-<link rel="next" href="compilers.html" title="Supported Compilers">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>
-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
+<link rel="next" href="compilers.html" title="Supported Compilers"></head>
+<body alink="#0000ff" bgcolor="white" link="#0000ff" text="black" vlink="#840084">
+<table cellpadding="2" width="100%"><tbody><tr>
+<td valign="top"><img alt="Boost C++ Libraries" src="../../../../../boost.png" height="86" width="277"></td>
 <td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
 <td align="center"><a href="../../../../../more/index.htm">More</a></td>
-</tr></table>
+</tr></tbody></table>
 <hr>
 <div class="spirit-nav">
<a accesskey="p" href="tutorial.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="compilers.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
 <div class="section" lang="en">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="scope_exit.alternatives"></a> Alternatives</h2></div></div></div>
+<div class="titlepage"><div><div><h2 class="title" style="clear: both;">
+<a name="scope_exit.alternatives"></a> Alternatives 其它选择 </h2></div></div></div>
 <a name="alternatives.try_catch"></a><h4>
 <a name="id1037675"></a>
       try-catch
@@ -33,13 +32,15 @@
This is an example of using a badly designed <code class="computeroutput"><span class="identifier">File</span></code> class. An instance of <code class="computeroutput"><span class="identifier">File</span></code> doesn't close a file in a destructor, a programmer is expected to call the - <code class="computeroutput"><span class="identifier">close</span></code> member function explicitly. + <code class="computeroutput"><span class="identifier">close</span></code> member function explicitly.<br>以下是 一个例子,它使用了一个设计得很差的 <code class="computeroutput"><span class="identifier">File</span></code> + 类。这个 <code class="computeroutput"><span class="identifier">File</span></code>
+      的实例不会在析构函数中关闭文件,程序员要明确地调用
+ <code class="computeroutput"><span class="identifier">close</span></code> 成员函数。
     </p>
<pre class="programlisting"><span class="identifier">File</span> <span class="identifier">passwd</span><span class="special">;</span>
 <span class="keyword">try</span> <span class="special">{</span>
<span class="identifier">passwd</span><span class="special">.</span><span class="identifier">open</span><span class="special">(</span><span class="string">"/etc/passwd"</span><span class="special">);</span>
-    <span class="comment">// ...
-</span> <span class="identifier">passwd</span><span class="special">.</span><span class="identifier">close</span><span class="special">();</span> + <span class="comment">// ...<br></span> <span class="identifier">passwd</span><span class="special">.</span><span class="identifier">close</span><span class="special">();</span>
 <span class="special">}</span>
<span class="keyword">catch</span><span class="special">(...)</span> <span class="special">{</span> <span class="identifier">log</span><span class="special">(</span><span class="string">"could not get user info"</span><span class="special">);</span>
@@ -49,35 +50,38 @@
 <span class="special">}</span>
 </pre>
 <p>
-      Note the following:
+      Note the following:<br>注意以下问题:
     </p>
 <div class="itemizedlist"><ul type="disc">
 <li>
the <code class="computeroutput"><span class="identifier">passwd</span></code> object is defined outside of the <code class="computeroutput"><span class="keyword">try</span></code> block because this object is required inside the <code class="computeroutput"><span class="keyword">catch</span></code>
-        block to close the file,
+ block to close the file,<br><code class="computeroutput"><span class="identifier">passwd</span></code> 对象是在 <code class="computeroutput"><span class="keyword">try</span></code> 块以外定义 的,因为这个对象要在 <code class="computeroutput"><span class="keyword">catch</span></code>
+        块中用于关闭文件,
       </li>
 <li>
the <code class="computeroutput"><span class="identifier">passwd</span></code> object is not fully constructed until after the <code class="computeroutput"><span class="identifier">open</span></code>
-        member function returns, and
+        member function returns, and<br>
+ <code class="computeroutput"><span class="identifier">passwd</span></code> 对象在 <code class="computeroutput"><span class="identifier">open</span></code>
+        成员函数返回之前是未完全构造的,而且
       </li>
 <li>
if opening throws, the <code class="computeroutput"><span class="identifier">passwd</span><span class="special">.</span><span class="identifier">close</span><span class="special">()</span></code> should not be called, hence the call to - <code class="computeroutput"><span class="identifier">passwd</span><span class="special">.</span><span class="identifier">is_open</span><span class="special">()</span></code>. + <code class="computeroutput"><span class="identifier">passwd</span><span class="special">.</span><span class="identifier">is_open</span><span class="special">()</span></code>.<br>如果打开文件时有异常抛出,不会调用 <code class="computeroutput"><span class="identifier">passwd</span><span class="special">.</span><span class="identifier">close</span><span class="special">()</span></code>,而是会调用 + <code class="computeroutput"><span class="identifier">passwd</span><span class="special">.</span><span class="identifier">is_open</span><span class="special">()</span></code>。
       </li>
 </ul></div>
 <p>
- <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> doesn't have any of these problems: + <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> doesn't have any of these problems:<br><a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> 没有这些问题:
     </p>
<pre class="programlisting"><span class="keyword">try</span> <span class="special">{</span> <span class="identifier">File</span> <span class="identifier">passwd</span><span class="special">(</span><span class="string">"/etc/passwd"</span><span class="special">);</span> <span class="identifier">BOOST_SCOPE_EXIT</span><span class="special">(</span> <span class="special">(&amp;</span><span class="identifier">passwd</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span> <span class="identifier">passwd</span><span class="special">.</span><span class="identifier">close</span><span class="special">();</span> <span class="special">}</span> <span class="identifier">BOOST_SCOPE_EXIT_END</span>
-    <span class="comment">// ...
-</span><span class="special">}</span>
+    <span class="comment">// ...<br></span><span class="special">}</span>
<span class="keyword">catch</span><span class="special">(...)</span> <span class="special">{</span> <span class="identifier">log</span><span class="special">(</span><span class="string">"could not get user info"</span><span class="special">);</span>
     <span class="keyword">throw</span><span class="special">;</span>
@@ -88,62 +92,66 @@
       RAII
     </h4>
 <p>
- <a href="http://www.research.att.com/~bs/glossary.html#Gresource-acquisition-is-initialization"; target="_top">RAII</a> + <a href="http://www.research.att.com/%7Ebs/glossary.html#Gresource-acquisition-is-initialization"; target="_top">RAII</a> is absolutely perfect for the <code class="computeroutput"><span class="identifier">File</span></code> class introduced above. Use of a properly designed <code class="computeroutput"><span class="identifier">File</span></code>
-      class would look like:
+ class would look like:<br>对于前面所说的 <code class="computeroutput"><span class="identifier">File</span></code> + 类,<a href="http://www.research.att.com/%7Ebs/glossary.html#Gresource-acquisition-is-initialization"; target="_top">RAII</a> + 绝对是完美的。使用一个正确设计的 <code class="computeroutput"><span class="identifier">File</span></code>
+      类,应该是这样的:
     </p>
<pre class="programlisting"><span class="keyword">try</span> <span class="special">{</span> <span class="identifier">File</span> <span class="identifier">passwd</span><span class="special">(</span><span class="string">"/etc/passwd"</span><span class="special">);</span>
-    <span class="comment">// ...
-</span><span class="special">}</span>
+    <span class="comment">// ...<br></span><span class="special">}</span>
<span class="keyword">catch</span><span class="special">(...)</span> <span class="special">{</span> <span class="identifier">log</span><span class="special">(</span><span class="string">"could not get user info"</span><span class="special">);</span>
     <span class="keyword">throw</span><span class="special">;</span>
 <span class="special">}</span>
 </pre>
 <p>
- However, using <a href="http://www.research.att.com/~bs/glossary.html#Gresource-acquisition-is-initialization"; target="_top">RAII</a> - to build up a <a href="http://www.research.att.com/~bs/glossary.html#Gstrong-guarantee"; target="_top">strong - guarantee</a> could introduce a lot of non-reusable <a href="http://www.research.att.com/~bs/glossary.html#Gresource-acquisition-is-initialization"; target="_top">RAII</a>
-      types. For example:
+ However, using <a href="http://www.research.att.com/%7Ebs/glossary.html#Gresource-acquisition-is-initialization"; target="_top">RAII</a> + to build up a <a href="http://www.research.att.com/%7Ebs/glossary.html#Gstrong-guarantee"; target="_top">strong + guarantee</a> could introduce a lot of non-reusable <a href="http://www.research.att.com/%7Ebs/glossary.html#Gresource-acquisition-is-initialization"; target="_top">RAII</a> + types. For example:<br>不过,使用 <a href="http://www.research.att.com/%7Ebs/glossary.html#Gresource-acquisition-is-initialization"; target="_top">RAII</a> + 来建立 <a href="http://www.research.att.com/%7Ebs/glossary.html#Gstrong-guarantee"; target="_top">强异常安全保证</a> 可能要引入大量不可复用的 <a href="http://www.research.att.com/%7Ebs/glossary.html#Gresource-acquisition-is-initialization"; target="_top">RAII</a>
+      类型。例如:
     </p>
<pre class="programlisting"><span class="identifier">m_persons</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">person</span><span class="special">);</span> <span class="identifier">pop_back_if_not_commit</span> <span class="identifier">pop_back_if_not_commit_guard</span><span class="special">(</span><span class="identifier">commit</span><span class="special">,</span> <span class="identifier">m_persons</span><span class="special">);</span>
 </pre>
 <p>
The <code class="computeroutput"><span class="identifier">pop_back_if_not_commit</span></code>
-      class is either defined out of the scope or as a local class:
+ class is either defined out of the scope or as a local class:<br>类 &nbsp;<code class="computeroutput"><span class="identifier">pop_back_if_not_commit</span></code>
+      要么在作用域之外定义,要么定义为一个局部类:
     </p>
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">pop_back_if_not_commit</span> <span class="special">{</span> <span class="keyword">bool</span> <span class="identifier">m_commit</span><span class="special">;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">Person</span><span class="special">&gt;&amp;</span> <span class="identifier">m_vec</span><span class="special">;</span>
-    <span class="comment">// ...
-</span> <span class="special">~</span><span class="identifier">pop_back_if_not_commit</span><span class="special">()</span> <span class="special">{</span> + <span class="comment">// ...<br></span> <span class="special">~</span><span class="identifier">pop_back_if_not_commit</span><span class="special">()</span> <span class="special">{</span> <span class="keyword">if</span><span class="special">(!</span><span class="identifier">m_commit</span><span class="special">)</span> <span class="identifier">m_vec</span><span class="special">.</span><span class="identifier">pop_back</span><span class="special">();</span>
     <span class="special">}</span>
 <span class="special">};</span>
 </pre>
 <p>
- In some cases <a href="http://www.research.att.com/~bs/glossary.html#Gstrong-guarantee"; target="_top">strong
-      guarantee</a> can be accomplished with standard utilities:
+ In some cases <a href="http://www.research.att.com/%7Ebs/glossary.html#Gstrong-guarantee"; target="_top">strong + guarantee</a> can be accomplished with standard utilities:<br>在某些 情况下,<a href="http://www.research.att.com/%7Ebs/glossary.html#Gstrong-guarantee"; target="_top">强异常安全保证</a> 可以用标准的工具来实现:
     </p>
-<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">auto_ptr</span><span class="special">&lt;</span><span class="identifier">Person</span><span class="special">&gt;</span> <span class="identifier">spSuperMan</span><span class="special">(</span><span class="keyword">new</span> <span class="identifier">Superman</span><span class="special">);</span> -<span class="identifier">m_persons</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">spSuperMan</span><span class="special">.</span><span class="identifier">get</span><span class="special">());</span> -<span class="identifier">spSuperMan</span><span class="special">.</span><span class="identifier">release</span><span class="special">();</span> <span class="comment">// m_persons successfully took ownership.
-</span></pre>
-<p>
- or with specialized containers such as <a href="../../../../../libs/ptr_container/doc/ptr_container.html" target="_top">Boost - Pointer Container Library</a> or <a href="../../../../../libs/multi_index/doc/index.html" target="_top">Boost
-      Multi-Index Containers Library</a>.
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">auto_ptr</span><span class="special">&lt;</span><span class="identifier">Person</span><span class="special">&gt;</span> <span class="identifier">spSuperMan</span><span class="special">(</span><span class="keyword">new</span> <span class="identifier">Superman</span><span class="special">);</span> <br><span class="identifier">m_persons</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">spSuperMan</span><span class="special">.</span><span class="identifier">get</span><span class="special">());</span> +<span class="identifier">spSuperMan</span><span class="special">.</span><span class="identifier">release</span><span class="special">();</span> <span class="comment">// m_persons successfully took ownership.<br></span></pre>
+<p>
+ or with specialized containers such as <a href="../../../../ptr_container/doc/ptr_container.html" target="_top">Boost + Pointer Container Library</a> or <a href="../../../../multi_index/doc/index.html" target="_top">Boost + Multi-Index Containers Library</a>.<br>或者用专用的容器,如 <a href="../../../../../libs/ptr_container/doc/ptr_container.html" target="_top">Boost + Pointer Container 库</a> 或 <a href="../../../../../libs/multi_index/doc/index.html" target="_top">Boost
+      Multi-Index Containers 库</a>。
     </p>
<a name="alternatives._ulink_url__http___www_ddj_com_dept_cpp_184403758__scopeguard__ulink_"></a><h4>
 <a name="id1038643"></a>
<a href="http://www.ddj.com/dept/cpp/184403758"; target="_top">ScopeGuard</a>
     </h4>
 <p>
-      Imagine that you add a new currency rate:
+ Imagine that you add a new currency rate:<br>假设你增加了一个新的货币 汇率:
     </p>
<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">commit</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">currency</span><span class="special">(</span><span class="string">"EUR"</span><span class="special">);</span>
@@ -156,7 +164,7 @@
and then continue a transaction. If it cannot be completed, you erase the currency from <code class="computeroutput"><span class="identifier">rates</span></code>. This is how you can do this with <a href="http://www.ddj.com/dept/cpp/184403758"; target="_top">ScopeGuard</a> - and <a href="../../../../../libs/lambda/index.html" target="_top">Boost.Lambda</a>: + and <a href="../../../../lambda/index.html" target="_top">Boost.Lambda</a>:<br>然后进行一个交易。如果交易不能完成,你要 从 <code class="computeroutput"><span class="identifier">rates</span></code> 中删除该货币。以下是如何用 <a href="http://www.ddj.com/dept/cpp/184403758"; target="_top">ScopeGuard</a> 和 <a href="../../../../../libs/lambda/index.html" target="_top">Boost.Lambda</a> 来实现的方法:
     </p>
<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">lambda</span><span class="special">;</span>

@@ -173,33 +181,34 @@
<span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">cref</span><span class="special">(</span><span class="identifier">commit</span><span class="special">)</span>
   <span class="special">);</span>

-<span class="comment">// ...
-</span>
+<span class="comment">// ...<br></span>
<span class="identifier">commit</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
 </pre>
 <p>
-      Note that
+      Note that<br>注意:
     </p>
 <div class="itemizedlist"><ul type="disc">
 <li>
Boost.lambda expressions are hard to write correctly, for example, overloaded - function must be explicitly casted, as demonstrated in this example, + function must be explicitly casted, as demonstrated in this example,<br>Boost.lambda 表达式很难被写对,例如,重载函数必须显式转型,就象 这个例子中所示范的一样,
       </li>
 <li>
condition in <code class="computeroutput"><span class="identifier">if_</span></code> expression refers to <code class="computeroutput"><span class="identifier">commit</span></code> variable indirectly through the <code class="computeroutput"><span class="identifier">_1</span></code>
-        placeholder,
+ placeholder,<br>在 <code class="computeroutput"><span class="identifier">if_</span></code> 表达式中的条件要间接通过 <code class="computeroutput"><span class="identifier">_1</span></code> + 占位符来引用 <code class="computeroutput"><span class="identifier">commit</span></code> 变量,
       </li>
 <li>
setting a breakpoint inside <code class="computeroutput"><span class="identifier">if_</span><span class="special">[</span> <span class="special">...</span> <span class="special">]</span></code> requires in-depth knowledge of <a href="../../../../../libs/lambda/index.html" target="_top">Boost.Lambda</a>
-        and debugging techniques.
+ and debugging techniques.<br>在 <code class="computeroutput"><span class="identifier">if_</span><span class="special">[</span> <span class="special">...</span> <span class="special">]</span></code> 内部设置断 点需要对 <a href="../../../../lambda/index.html" target="_top">Boost.Lambda</a>
+        和调试技巧有深入了解。
       </li>
 </ul></div>
 <p>
This code will look much better with native lambda expressions proposed for
-      C++0x:
+      C++0x:<br>如果使用C++0x所建议的原生 lambda 表达式,代码会好看一些:
     </p>
<pre class="programlisting"><span class="identifier">ON_BLOCK_EXIT</span><span class="special">(</span> <span class="special">[</span><span class="identifier">currency_rate_inserted</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">commit</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">rates</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">currency</span><span class="special">]()</span> <span class="special">-&gt;</span> <span class="keyword">void</span>
@@ -210,7 +219,7 @@
 <span class="special">);</span>
 </pre>
 <p>
- With <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> you can simply do + With <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> you can simply do<br>如果用 <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a>,你只要这样:
     </p>
<pre class="programlisting"><span class="identifier">BOOST_SCOPE_EXIT</span><span class="special">(</span> <span class="special">(</span><span class="identifier">currency_rate_inserted</span><span class="special">)(&amp;</span><span class="identifier">commit</span><span class="special">)(&amp;</span><span class="identifier">rates</span><span class="special">)(&amp;</span><span class="identifier">currency</span><span class="special">)</span> <span class="special">)</span>
 <span class="special">{</span>
@@ -218,8 +227,7 @@
<span class="identifier">rates</span><span class="special">.</span><span class="identifier">erase</span><span class="special">(</span><span class="identifier">currency</span><span class="special">);</span> <span class="special">}</span> <span class="identifier">BOOST_SCOPE_EXIT_END</span>

-<span class="comment">// ...
-</span>
+<span class="comment">// ...<br></span>
<span class="identifier">commit</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
 </pre>
 <a name="alternatives.c__0x"></a><h4>
@@ -227,12 +235,13 @@
       C++0x
     </h4>
 <p>
- In future releases <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> will take advantages
-      of C++0x features.
+ In future releases <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> will take advantages + of C++0x features.<br>未来的 <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> 版本将会利用 C++0x特性的优点。
     </p>
 <div class="itemizedlist"><ul type="disc"><li>
Passing capture list as <a href="../../../../../libs/preprocessor/index.html" target="_top">Boost.Preprocessor - sequence</a> will be replaced with a traditional macro invocation style: + sequence</a> will be replaced with a traditional macro invocation style:<br>以 <a href="../../../../preprocessor/index.html" target="_top">Boost.Preprocessor
+        序列</a> 来传递捕获变量列表将被替代为传统的宏调用风格:
       </li></ul></div>
<pre class="programlisting"><span class="identifier">BOOST_SCOPE_EXIT</span><span class="special">(</span><span class="identifier">currency_rate_inserted</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">commit</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">rates</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">currency</span><span class="special">)</span>
 <span class="special">{</span>
@@ -242,7 +251,7 @@
 </pre>
 <div class="itemizedlist"><ul type="disc"><li>
<code class="computeroutput"><span class="identifier">BOOST_SCOPE_EXIT_END</span></code> will
-        be replaced with a semicolon:
+ be replaced with a semicolon:<br><code class="computeroutput"><span class="identifier">BOOST_SCOPE_EXIT_END</span></code> 将被代之以分号:
       </li></ul></div>
<pre class="programlisting"><span class="identifier">BOOST_SCOPE_EXIT</span><span class="special">(</span><span class="identifier">currency_rate_inserted</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">commit</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">rates</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">currency</span><span class="special">)</span>
 <span class="special">{</span>
@@ -252,7 +261,7 @@
 </pre>
 <div class="itemizedlist"><ul type="disc"><li>
Users will be able to capture local variables implicitly with lambda capture - defaults <code class="computeroutput"><span class="special">&amp;</span></code> and <code class="computeroutput"><span class="special">=</span></code>: + defaults <code class="computeroutput"><span class="special">&amp;</span></code> and <code class="computeroutput"><span class="special">=</span></code>:<br>用户可以用 lambda 捕获缺省的 <code class="computeroutput"><span class="special">&amp;</span></code> 和 <code class="computeroutput"><span class="special">=</span></code> 来隐式捕获局部 变量:
       </li></ul></div>
<pre class="programlisting"><span class="identifier">BOOST_SCOPE_EXIT</span><span class="special">(&amp;,</span> <span class="identifier">currency_rate_inserted</span><span class="special">)</span>
 <span class="special">{</span>
@@ -262,16 +271,18 @@
 </pre>
 <div class="itemizedlist"><ul type="disc"><li>
It will be possible to capture <code class="computeroutput"><span class="keyword">this</span></code>
-        pointer.
+ pointer.<br>有可能可以捕获 <code class="computeroutput"><span class="keyword">this</span></code>
+        指针。
       </li></ul></div>
 <a name="alternatives.the_d_programming_language"></a><h4>
 <a name="id1040070"></a>
-      The D Programming Language
+      The D Programming Language &nbsp;D语言
     </h4>
 <p>
<span class="underline">ScopeExit</span> is similar to <a href="http://www.digitalmars.com/d/2.0/statement.html#ScopeGuardStatement"; target="_top">scope(exit)</a> feature built into the <a href="http://www.digitalmars.com/d/index.html"; target="_top">D</a>
-      programming language.
+ programming language.<br><span class="underline">ScopeExit</span> 类 似于在 <a href="http://www.digitalmars.com/d/index.html"; target="_top">D</a> 语言中内建的 <a href="http://www.digitalmars.com/d/2.0/statement.html#ScopeGuardStatement"; target="_top">scope(exit)</a> + 特性。<a href="http://www.digitalmars.com/d/index.html"; target="_top"></a>&nbsp;
     </p>
 <p>
A curious reader may notice that the library doesn't implement <code class="computeroutput"><span class="identifier">scope</span><span class="special">(</span><span class="identifier">success</span><span class="special">)</span></code> and <code class="computeroutput"><span class="identifier">scope</span><span class="special">(</span><span class="identifier">failure</span><span class="special">)</span></code> of the <a href="http://www.digitalmars.com/d/index.html"; target="_top">D</a>
@@ -283,21 +294,21 @@
variable as explained in <a class="link" href="tutorial.html" title="Tutorial">Tutorial</a>. Refer to <a href="http://www.gotw.ca/gotw/047.htm"; target="_top">Guru of the Week #47</a> for more details about <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">uncaught_exception</span></code>
-      and if it has any good use at all.
+ and if it has any good use at all.<br>好奇的读者可能已经注意到,本库 没有实现 <a href="http://www.digitalmars.com/d/index.html"; target="_top">D</a>&nbsp;语言的 <code class="computeroutput"><span class="identifier">scope</span><span class="special">(</span><span class="identifier">success</span><span class="special">)</span></code> 和 <code class="computeroutput"><span class="identifier">scope</span><span class="special">(</span><span class="identifier">failure</span><span class="special">)</span></code>。很不幸,在C++中它们是不可能实现的,因为不可 能通过调用 <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">uncaught_exception</span></code> 来确定失败或成功的条件。 不过这不是一个大问题。这两个结构可以根据 <a href="http://www.digitalmars.com/d/2.0/statement.html#ScopeGuardStatement"; target="_top">scope(exit)</a> 和一个 <code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">commit</span></code> + 变量来表示,正如在 <a class="link" href="tutorial.html" title="Tutorial">教程</a> 中所介绍的。关于 的更多细节,以及好的用法,请参考 <a href="http://www.gotw.ca/gotw/047.htm"; target="_top">Guru of the Week #47</a>。
     </p>
 </div>
-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tbody><tr>
 <td align="left"></td>
-<td align="right"><div class="copyright-footer">Copyright 2006 -2009 Alexander Nasonov<p> +<td align="right"><div class="copyright-footer">Copyright (c) 2006 -2009 Alexander Nasonov<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">
         http://www.boost.org/LICENSE_1_0.txt </a>)
       </p>
 </div></td>
-</tr></table>
+</tr></tbody></table>
 <hr>
 <div class="spirit-nav">
<a accesskey="p" href="tutorial.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="compilers.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
-</body>
-</html>
+</body></html>
\ No newline at end of file

Modified: trunk/libs/scope_exit/doc/html/scope_exit/compilers.html
==============================================================================
--- trunk/libs/scope_exit/doc/html/scope_exit/compilers.html    (original)
+++ trunk/libs/scope_exit/doc/html/scope_exit/compilers.html Wed Apr 1 03:09:45 2009
@@ -1,61 +1,63 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Supported Compilers</title>
-<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+
+<title>Supported Compilers</title><link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
 <meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
-<link rel="home" href="../index.html" title="Chapter 1. Boost.ScopeExit">
-<link rel="up" href="../index.html" title="Chapter 1. Boost.ScopeExit">
+<link rel="home" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit"> +<link rel="up" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">
 <link rel="prev" href="alternatives.html" title="Alternatives">
-<link rel="next" href="conf.html" title="Configuration">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>
-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
+<link rel="next" href="conf.html" title="Configuration"></head>
+<body alink="#0000ff" bgcolor="white" link="#0000ff" text="black" vlink="#840084">
+<table cellpadding="2" width="100%"><tbody><tr>
+<td valign="top"><img alt="Boost C++ Libraries" src="../../../../../boost.png" height="86" width="277"></td>
 <td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
 <td align="center"><a href="../../../../../more/index.htm">More</a></td>
-</tr></table>
+</tr></tbody></table>
 <hr>
 <div class="spirit-nav">
<a accesskey="p" href="alternatives.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="conf.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
 <div class="section" lang="en">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="scope_exit.compilers"></a> Supported Compilers</h2></div></div></div>
+<div class="titlepage"><div><div><h2 class="title" style="clear: both;">
+<a name="scope_exit.compilers"></a> Supported Compilers 支持的编译器 </h2></div></div></div>
 <p>
- The library should be usable on any compiler that supports <a href="../../../../../libs/typeof/index.html" target="_top">Boost.Typeof</a>
-      except
+ The library should be usable on any compiler that supports <a href="../../../../typeof/index.html" target="_top">Boost.Typeof</a> + except<br>本库应该可以用于任何支持 <a href="../../../../../libs/typeof/index.html" target="_top">Boost.Typeof</a>
+      的编译器,除了:
     </p>
 <div class="itemizedlist"><ul type="disc">
 <li>
- MSVC 7.1 and 8.0 fail to link if a function with <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a>
-        is included by multiple translation units.
+ MSVC 7.1 and 8.0 fail to link if a function with <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a>
+        is included by multiple translation units.<br>
+ MSVC 7.1 和 8.0 会链接失败,如果一个带 <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a>
+        的函数被多个编译单元包含。
       </li>
 <li>
- GCC 3.3 can't compile <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> inside + GCC 3.3 can't compile <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> inside a template. See <a href="http://lists.boost.org/Archives/boost/2007/02/116235.php"; target="_top">this
-        thread</a> for more details.
+        thread</a> for more details.<br>
+ GCC 3.3 不能编译在模板内的 <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a>。更多细节请见 <a href="http://lists.boost.org/Archives/boost/2007/02/116235.php"; target="_top">此帖</a>。
       </li>
 </ul></div>
 <p>
- The author tested the library on GCC 3.3, 3.4, 4.1, 4.2 and Intel 10.1. + The author tested the library on GCC 3.3, 3.4, 4.1, 4.2 and Intel 10.1.<br>作者已在 GCC 3.3, 3.4, 4.1, 4.2 和 Intel 10.1 上测试过本库。.
     </p>
 </div>
-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tbody><tr>
 <td align="left"></td>
-<td align="right"><div class="copyright-footer">Copyright 2006 -2009 Alexander Nasonov<p> +<td align="right"><div class="copyright-footer">Copyright (c) 2006 -2009 Alexander Nasonov<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">
         http://www.boost.org/LICENSE_1_0.txt </a>)
       </p>
 </div></td>
-</tr></table>
+</tr></tbody></table>
 <hr>
 <div class="spirit-nav">
<a accesskey="p" href="alternatives.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="conf.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
-</body>
-</html>
+</body></html>
\ No newline at end of file

Modified: trunk/libs/scope_exit/doc/html/scope_exit/conf.html
==============================================================================
--- trunk/libs/scope_exit/doc/html/scope_exit/conf.html (original)
+++ trunk/libs/scope_exit/doc/html/scope_exit/conf.html Wed Apr 1 03:09:45 2009
@@ -1,49 +1,48 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Configuration</title>
-<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+
+<title>Configuration</title><link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
 <meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
-<link rel="home" href="../index.html" title="Chapter 1. Boost.ScopeExit">
-<link rel="up" href="../index.html" title="Chapter 1. Boost.ScopeExit">
+<link rel="home" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit"> +<link rel="up" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">
 <link rel="prev" href="compilers.html" title="Supported Compilers">
-<link rel="next" href="ref.html" title="Reference">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>
-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
+<link rel="next" href="ref.html" title="Reference"></head>
+<body alink="#0000ff" bgcolor="white" link="#0000ff" text="black" vlink="#840084">
+<table cellpadding="2" width="100%"><tbody><tr>
+<td valign="top"><img alt="Boost C++ Libraries" src="../../../../../boost.png" height="86" width="277"></td>
 <td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
 <td align="center"><a href="../../../../../more/index.htm">More</a></td>
-</tr></table>
+</tr></tbody></table>
 <hr>
 <div class="spirit-nav">
<a accesskey="p" href="compilers.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="ref.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
 <div class="section" lang="en">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="scope_exit.conf"></a> Configuration</h2></div></div></div>
+<div class="titlepage"><div><div><h2 class="title" style="clear: both;">
+<a name="scope_exit.conf"></a> Configuration 配置</h2></div></div></div>
 <p>
Normally, no configuration is required for the library but note that the library - depends on <a href="../../../../../libs/typeof/index.html" target="_top">Boost.Typeof</a> - and you may want to configure or enforce <a href="../../../../../libs/typeof/index.html" target="_top">typeof
-      emulation</a>.
+ depends on <a href="../../../../typeof/index.html" target="_top">Boost.Typeof</a> + and you may want to configure or enforce <a href="../../../../typeof/index.html" target="_top">typeof + emulation</a>.<br>基本上,本库不需要什么配置,不过要注意,本库依赖于 <a href="../../../../../libs/typeof/index.html" target="_top">Boost.Typeof</a>,你可能需要配置或强制 <a href="../../../../../libs/typeof/index.html" target="_top">typeof
+      仿真</a>。
     </p>
 </div>
-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tbody><tr>
 <td align="left"></td>
-<td align="right"><div class="copyright-footer">Copyright 2006 -2009 Alexander Nasonov<p> +<td align="right"><div class="copyright-footer">Copyright (c) 2006 -2009 Alexander Nasonov<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">
         http://www.boost.org/LICENSE_1_0.txt </a>)
       </p>
 </div></td>
-</tr></table>
+</tr></tbody></table>
 <hr>
 <div class="spirit-nav">
<a accesskey="p" href="compilers.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="ref.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
-</body>
-</html>
+</body></html>
\ No newline at end of file

Modified: trunk/libs/scope_exit/doc/html/scope_exit/ref.html
==============================================================================
--- trunk/libs/scope_exit/doc/html/scope_exit/ref.html  (original)
+++ trunk/libs/scope_exit/doc/html/scope_exit/ref.html Wed Apr 1 03:09:45 2009
@@ -1,37 +1,36 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Reference</title>
-<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+
+<title>Reference</title><link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
 <meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
-<link rel="home" href="../index.html" title="Chapter 1. Boost.ScopeExit">
-<link rel="up" href="../index.html" title="Chapter 1. Boost.ScopeExit">
+<link rel="home" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit"> +<link rel="up" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">
 <link rel="prev" href="conf.html" title="Configuration">
-<link rel="next" href="acknowledge.html" title="Acknowledge">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>
-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
+<link rel="next" href="acknowledge.html" title="Acknowledge"></head>
+<body alink="#0000ff" bgcolor="white" link="#0000ff" text="black" vlink="#840084">
+<table cellpadding="2" width="100%"><tbody><tr>
+<td valign="top"><img alt="Boost C++ Libraries" src="../../../../../boost.png" height="86" width="277"></td>
 <td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
 <td align="center"><a href="../../../../../more/index.htm">More</a></td>
-</tr></table>
+</tr></tbody></table>
 <hr>
 <div class="spirit-nav">
<a accesskey="p" href="conf.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="acknowledge.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
 <div class="section" lang="en">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="scope_exit.ref"></a> Reference</h2></div></div></div>
+<div class="titlepage"><div><div><h2 class="title" style="clear: both;">
+<a name="scope_exit.ref"></a> Reference 参考手册</h2></div></div></div>
 <a name="ref.boost_scope_exit"></a><h4>
 <a name="id1040305"></a>
       BOOST_SCOPE_EXIT
     </h4>
 <p>
- A <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> declaration has the following
-      synopsis:
+ A <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> declaration has the following + synopsis:<br>一个 <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> 声明具有以下语 法:
     </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">scope_exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>

@@ -40,7 +39,7 @@
 <span class="identifier">BOOST_SCOPE_EXIT_END</span>
 </pre>
 <p>
-      where
+      where<br>其中
     </p>
<pre class="programlisting"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span><span class="special">:</span> <span class="special">(</span> <span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span> <span class="special">)</span>
@@ -51,11 +50,12 @@
<span class="special">&amp;</span><span class="identifier">identifier</span>
 </pre>
 <p>
- The <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> declaration schedules an execution + The <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> declaration schedules an execution of <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code> at the end of the current scope. The <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code> statements are executed in the reverse - order of <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> declarations in the given
-      scope. The scope must be local.
+ order of <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> declarations in the given + scope. The scope must be local.<br><a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> 声明将 <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code> + 的执行时间分配至当前作用域的结束处。<code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code> 语句按给 作用域中的 <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> 声明的相反顺序来 执行。作用域必须是局部的。
     </p>
 <p>
Each <code class="computeroutput"><span class="identifier">identifier</span></code> in <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span></code> must
@@ -64,32 +64,37 @@
starts with the ampersand sign <code class="computeroutput"><span class="special">&amp;</span></code>, the corresponding <code class="computeroutput"><span class="identifier">identifier</span></code> will be available inside <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code>; otherwise, a copy of it will be made - at the point of <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> declaration and - that copy will be available inside <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code>. In the latter case, the <code class="computeroutput"><span class="identifier">idenitifer</span></code> must be <code class="computeroutput"><span class="identifier">CopyConstructible</span></code>. + at the point of <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> declaration and + that copy will be available inside <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code>. In the latter case, the <code class="computeroutput"><span class="identifier">idenitifer</span></code> must be <code class="computeroutput"><span class="identifier">CopyConstructible</span></code>.<br>在&nbsp;<code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span></code>&nbsp;中 的每一个 <code class="computeroutput"><span class="identifier">identifier</span></code> 必须是其所在作用域中的一个有效名 字<code class="computeroutput"><span class="identifier"></span></code>,且必 须只在列表中出现刚好一次。如果一个 <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span></code> + 是以 <code class="computeroutput"><span class="special">&amp;</span></code> 符号打头的,则相对应的 <code class="computeroutput"><span class="identifier">identifier</span></code>&nbsp;在 <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code> 中是可用 的;否则,就在 <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> 声明处创建一份拷 贝,并在 <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code> 中使用该拷贝。在后一种情况下,<code class="computeroutput"><span class="identifier">idenitifer</span></code> 必 须是 <code class="computeroutput"><span class="identifier">CopyConstructible</span></code> 的。
     </p>
 <p>
Only identifiers listed in <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span></code>, static variables, <code class="computeroutput"><span class="keyword">extern</span></code> variables and functions, and enumerations from the enclosing scope can be used - inside the <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code>. + inside the <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code>.<br>只有在 <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span></code> 中列出的 标识符、静态变量、<code class="computeroutput"><span class="keyword">extern</span></code> + 变量和函数,以及所在作用域中的枚举值,可以在 <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code> 中使用。
     </p>
-<div class="note"><table border="0" summary="Note">
-<tr>
+<div class="note"><table summary="Note" border="0">
+<tbody><tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../doc/html/images/note.png"></td>
-<th align="left">Note</th>
+<th align="left">Note 备注</th>
 </tr>
 <tr><td align="left" valign="top"><p>
<code class="computeroutput"><span class="keyword">this</span></code> pointer is not an identifier - and cannot be passed to <code class="computeroutput"> <span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span></code>. + and cannot be passed to <code class="computeroutput"> <span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span></code>.</p><p><code class="computeroutput"><span class="keyword">this</span></code> 指针不是标识 符,不能被传递给 <code class="computeroutput"> <span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span></code>.
       </p></td></tr>
-</table></div>
+</tbody></table></div>
 <p>
- The <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> uses <a href="../../../../../libs/typeof/index.html" target="_top">Boost.Typeof</a> + The <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> uses <a href="../../../../typeof/index.html" target="_top">Boost.Typeof</a> to determine types of <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span></code> elements. In order to compile code in - <a href="../../../../../libs/typeof/index.html" target="_top">typeof emulation</a> mode, + <a href="../../../../typeof/index.html" target="_top">typeof emulation</a> mode, all types should be registered with <a href="../../../../../doc/html/typeof/refe.html#typeof.regtype" target="_top">BOOST_TYPEOF_REGISTER_TYPE</a> or <a href="../../../../../doc/html/typeof/refe.html#typeof.regtemp" target="_top">BOOST_TYPEOF_REGISTER_TEMPLATE</a> - macros, or appropriate <a href="../../../../../libs/typeof/index.html" target="_top">Boost.Typeof</a>
-      headers should be included.
+ macros, or appropriate <a href="../../../../typeof/index.html" target="_top">Boost.Typeof</a> + headers should be included.<br><a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> 使用了 <a href="../../../../../libs/typeof/index.html" target="_top">Boost.Typeof</a> + 来判断 <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span></code> 元素的类型。为了可以在 + <a href="../../../../../libs/typeof/index.html" target="_top">typeof 仿真</a> 模式下编译代码,所有类型都要用 <a href="../../../../../doc/html/typeof/refe.html#typeof.regtype" target="_top">BOOST_TYPEOF_REGISTER_TYPE</a> 或 <a href="../../../../../doc/html/typeof/refe.html#typeof.regtemp" target="_top">BOOST_TYPEOF_REGISTER_TEMPLATE</a> + 宏来注册,或者包含正确的 <a href="../../../../../libs/typeof/index.html" target="_top">Boost.Typeof</a> 头文件。
     </p>
 <a name="ref.boost_scope_exit_tpl"></a><h4>
 <a name="id1041009"></a>
@@ -97,12 +102,13 @@
     </h4>
 <p>
This macro is a workaround for various versions of gcc. These compilers don't - compile <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> declaration inside function + compile <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> declaration inside function templates. As a workaround, the <code class="computeroutput"><span class="identifier">_TPL</span></code> - suffix should be appended to <code class="computeroutput"><span class="identifier">BOOST_SCOPE_EXIT</span></code>. + suffix should be appended to <code class="computeroutput"><span class="identifier">BOOST_SCOPE_EXIT</span></code>.<br>这个宏是多个 gcc 版本 的变通方法。这些编译器不能编译在函数模板内部的 <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> 声明。作为变通的 办法,将 <code class="computeroutput"><span class="identifier">_TPL</span></code> + 后缀添加到 <code class="computeroutput"><span class="identifier">BOOST_SCOPE_EXIT</span></code> 上。
     </p>
 <p>
-      The problem boils down to the following code:
+ The problem boils down to the following code:<br>这个问题可以归结至以 下代码:
     </p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">void</span> <span class="identifier">foo</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">t</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
@@ -118,36 +124,38 @@
 </pre>
 <p>
This can be fixed by adding <code class="computeroutput"><span class="keyword">typename</span></code> - in front of <code class="computeroutput"><span class="identifier">Local</span><span class="special">::</span><span class="identifier">typeof_i</span></code> and <code class="computeroutput"><span class="identifier">Local</span><span class="special">::</span><span class="identifier">typeof_t</span></code>. + in front of <code class="computeroutput"><span class="identifier">Local</span><span class="special">::</span><span class="identifier">typeof_i</span></code> and <code class="computeroutput"><span class="identifier">Local</span><span class="special">::</span><span class="identifier">typeof_t</span></code>.<br>这可以通过在 <code class="computeroutput"><span class="identifier">Local</span><span class="special">::</span><span class="identifier">typeof_i</span></code> 和 <code class="computeroutput"><span class="identifier">Local</span><span class="special">::</span><span class="identifier">typeof_t</span></code> 前 面增加 <code class="computeroutput"><span class="keyword">typename</span></code>
+      来解决。
     </p>
 <p>
See also <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37920"; target="_top">GCC + bug 37920</a>.<br>参见 <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37920"; target="_top">GCC
       bug 37920</a>.
     </p>
-<div class="note"><table border="0" summary="Note">
-<tr>
+<div class="note"><table summary="Note" border="0">
+<tbody><tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../doc/html/images/note.png"></td>
-<th align="left">Note</th>
+<th align="left">Note 备注</th>
 </tr>
 <tr><td align="left" valign="top"><p>
Although <code class="computeroutput"><span class="identifier">BOOST_SCOPE_EXIT_TPL</span></code> has the same suffix as the <code class="computeroutput"><span class="identifier">BOOST_TYPEOF_TPL</span></code>, - it doesn't follow a convention of the <a href="../../../../../libs/typeof/index.html" target="_top">Boost.Typeof</a>. + it doesn't follow a convention of the <a href="../../../../typeof/index.html" target="_top">Boost.Typeof</a>.<br>虽 然 <code class="computeroutput"><span class="identifier">BOOST_SCOPE_EXIT_TPL</span></code> + 具有与 <code class="computeroutput"><span class="identifier">BOOST_TYPEOF_TPL</span></code> 相同的后缀,不过它并不遵 循 <a href="../../../../../libs/typeof/index.html" target="_top">Boost.Typeof</a> 的协定。
       </p></td></tr>
-</table></div>
+</tbody></table></div>
 </div>
-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tbody><tr>
 <td align="left"></td>
-<td align="right"><div class="copyright-footer">Copyright 2006 -2009 Alexander Nasonov<p> +<td align="right"><div class="copyright-footer">Copyright (c) 2006 -2009 Alexander Nasonov<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">
         http://www.boost.org/LICENSE_1_0.txt </a>)
       </p>
 </div></td>
-</tr></table>
+</tr></tbody></table>
 <hr>
 <div class="spirit-nav">
<a accesskey="p" href="conf.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="acknowledge.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
-</body>
-</html>
+</body></html>
\ No newline at end of file

Modified: trunk/libs/scope_exit/doc/html/scope_exit/tutorial.html
==============================================================================
--- trunk/libs/scope_exit/doc/html/scope_exit/tutorial.html     (original)
+++ trunk/libs/scope_exit/doc/html/scope_exit/tutorial.html Wed Apr 1 03:09:45 2009
@@ -1,78 +1,77 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Tutorial</title>
-<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+
+<title>Tutorial</title><link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
 <meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
-<link rel="home" href="../index.html" title="Chapter 1. Boost.ScopeExit">
-<link rel="up" href="../index.html" title="Chapter 1. Boost.ScopeExit">
-<link rel="prev" href="../index.html" title="Chapter 1. Boost.ScopeExit">
-<link rel="next" href="alternatives.html" title="Alternatives">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>
-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> +<link rel="home" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit"> +<link rel="up" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit"> +<link rel="prev" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">
+<link rel="next" href="alternatives.html" title="Alternatives"></head>
+<body alink="#0000ff" bgcolor="white" link="#0000ff" text="black" vlink="#840084">
+<table cellpadding="2" width="100%"><tbody><tr>
+<td valign="top"><img alt="Boost C++ Libraries" src="../../../../../boost.png" height="86" width="277"></td>
 <td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
 <td align="center"><a href="../../../../../more/index.htm">More</a></td>
-</tr></table>
+</tr></tbody></table>
 <hr>
 <div class="spirit-nav">
<a accesskey="p" href="../index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="alternatives.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
 <div class="section" lang="en">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="scope_exit.tutorial"></a> Tutorial</h2></div></div></div>
+<div class="titlepage"><div><div><h2 class="title" style="clear: both;">
+<a name="scope_exit.tutorial"></a> Tutorial 教程</h2></div></div></div>
 <p>
Imagine that you want to make many modifications to data members of the <code class="computeroutput"><span class="identifier">World</span></code> class in the <code class="computeroutput"><span class="identifier">World</span><span class="special">::</span><span class="identifier">addPerson</span></code> function. You start with adding a new <code class="computeroutput"><span class="identifier">Person</span></code>
-      object to a vector of persons:
+ object to a vector of persons:<br>想象一下,你要在 <code class="computeroutput"><span class="identifier">World</span><span class="special">::</span><span class="identifier">addPerson</span></code> + 函数中对 <code class="computeroutput"><span class="identifier">World</span></code> 类的数据成员作大量修改。首先,你要增 加一个新的 <code class="computeroutput"><span class="identifier">Person</span></code>
+      对象到一个 persons 向量中:
     </p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">World</span><span class="special">::</span><span class="identifier">addPerson</span><span class="special">(</span><span class="identifier">Person</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">person</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">bool</span> <span class="identifier">commit</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">;</span> - <span class="identifier">m_persons</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">person</span><span class="special">);</span> <span class="comment">// (1) direct action
-</span></pre>
+ <span class="identifier">m_persons</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">person</span><span class="special">);</span> <span class="comment">// (1) direct action 直接动 作<br></span></pre>
 <p>
Some operation down the road may throw an exception and all changes to involved objects should be rolled back. This all-or-nothing semantic is also known as - <a href="http://www.research.att.com/~bs/glossary.html#Gstrong-guarantee"; target="_top">strong
-      guarantee</a>.
+ <a href="http://www.research.att.com/%7Ebs/glossary.html#Gstrong-guarantee"; target="_top">strong + guarantee</a>.<br>接下来的一些操作有可能会抛出异常,这时所有相关对象 的修改应该要回滚。这是"全部或没有"的语义,被称为 <a href="http://www.research.att.com/%7Ebs/glossary.html#Gstrong-guarantee"; target="_top">强异常安全保证</a>。
     </p>
 <p>
In particular, last added person must be deleted from <code class="computeroutput"><span class="identifier">m_persons</span></code> when the function throws. All you need is to define a delayed action (release
-      of a resource) right after the direct action (resource acquisition):
+ of a resource) right after the direct action (resource acquisition):<br>在这个例子中,当函数抛出异常时,最后加入的 person 必须要从 <code class="computeroutput"><span class="identifier">m_persons</span></code> + 中删掉。你要做的就是,紧接在直接动作(资源获取)后定义一个延迟动作(资源 释放):
     </p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">World</span><span class="special">::</span><span class="identifier">addPerson</span><span class="special">(</span><span class="identifier">Person</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">aPerson</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">bool</span> <span class="identifier">commit</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">;</span> - <span class="identifier">m_persons</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">aPerson</span><span class="special">);</span> <span class="comment">// (1) direct action -</span> <span class="identifier">BOOST_SCOPE_EXIT</span><span class="special">(</span> <span class="special">(&amp;</span><span class="identifier">commit</span><span class="special">)(&amp;</span><span class="identifier">m_persons</span><span class="special">)</span> <span class="special">)</span> + <span class="identifier">m_persons</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">aPerson</span><span class="special">);</span> <span class="comment">// (1) direct action 直接动 作<br></span> <span class="identifier">BOOST_SCOPE_EXIT</span><span class="special">(</span> <span class="special">(&amp;</span><span class="identifier">commit</span><span class="special">)(&amp;</span><span class="identifier">m_persons</span><span class="special">)</span> <span class="special">)</span>
     <span class="special">{</span>
<span class="keyword">if</span><span class="special">(!</span><span class="identifier">commit</span><span class="special">)</span> - <span class="identifier">m_persons</span><span class="special">.</span><span class="identifier">pop_back</span><span class="special">();</span> <span class="comment">// (2) rollback action -</span> <span class="special">}</span> <span class="identifier">BOOST_SCOPE_EXIT_END</span> + <span class="identifier">m_persons</span><span class="special">.</span><span class="identifier">pop_back</span><span class="special">();</span> <span class="comment">// (2) rollback action 回滚 动作<br></span> <span class="special">}</span> <span class="identifier">BOOST_SCOPE_EXIT_END</span>

- <span class="comment">// ... // (3) other operations
-</span>
- <span class="identifier">commit</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span> <span class="comment">// (4) turn all rollback actions into no-op
-</span><span class="special">}</span>
+ <span class="comment">// ... // (3) other operations 其它操作<br></span> <br> <span class="identifier">commit</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span> <span class="comment">// (4) turn all rollback actions into no-op 将所有回滚 动作变为空操作<br></span><span class="special">}</span>
 </pre>
 <p>
- The block below point <code class="computeroutput"><span class="special">(</span><span class="number">1</span><span class="special">)</span></code> is a <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> - declaration. Unlike point <code class="computeroutput"><span class="special">(</span><span class="number">1</span><span class="special">)</span></code>, an execution of the <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> + The block below point <code class="computeroutput"><span class="special">(</span><span class="number">1</span><span class="special">)</span></code> is a <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> + declaration. Unlike point <code class="computeroutput"><span class="special">(</span><span class="number">1</span><span class="special">)</span></code>, an execution of the <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> body will be delayed until the end of the current scope. In this case it will be executed either after point <code class="computeroutput"><span class="special">(</span><span class="number">4</span><span class="special">)</span></code> or on any
-      exception.
+ exception.<br>在 <code class="computeroutput"><span class="special">(</span><span class="number">1</span><span class="special">)</span></code> 之后的代码块是一个 <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> + 声明。与 <code class="computeroutput"><span class="special">(</span><span class="number">1</span><span class="special">)</span></code> 不同,<a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> + 块的执行将被延迟至当前作用域的结尾处。在这个例子中,它会在 <code class="computeroutput"><span class="special">(</span><span class="number">4</span><span class="special">)</span></code> 之后或者异常抛 出之后执行。
     </p>
 <p>
- The <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> declaration starts with <code class="computeroutput"><span class="identifier">BOOST_SCOPE_EXIT</span></code> macro invocation which accepts - <a href="../../../../../libs/preprocessor/index.html" target="_top">Boost.Preprocessor sequence</a> + The <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> declaration starts with <code class="computeroutput"><span class="identifier">BOOST_SCOPE_EXIT</span></code> macro invocation which accepts + <a href="../../../../preprocessor/index.html" target="_top">Boost.Preprocessor sequence</a> of captured variables. If a capture starts with the ampersand sign <code class="computeroutput"><span class="special">&amp;</span></code>, a reference to the captured variable - will be available inside the <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> body; + will be available inside the <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> body; otherwise, a copy of the variable will be made after the point <code class="computeroutput"><span class="special">(</span><span class="number">1</span><span class="special">)</span></code>
-      and only the copy will be available inside the body.
+ and only the copy will be available inside the body.<br><a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> 声明以一个 <code class="computeroutput"><span class="identifier">BOOST_SCOPE_EXIT</span></code> 宏调用开头,该宏接受一个由 捕获变量组成的 <a href="../../../../../libs/preprocessor/index.html" target="_top">Boost.Preprocessor 序列</a>。如果捕获变量是以 <code class="computeroutput"><span class="special">&amp;</span></code> 符号开 头,则可以在 <a class="link" href="../index.html" title="Chapter&nbsp;1.&nbsp;Boost.ScopeExit">ScopeExit</a> 块中使用该捕获变 量的引用;否则将在 <code class="computeroutput"><span class="special">(</span><span class="number">1</span><span class="special">)</span></code>
+      之后创建该变量的一份拷贝,且在代码块中只可使用该拷贝。
     </p>
 <p>
In the example above, variables <code class="computeroutput"><span class="identifier">commit</span></code>
@@ -81,13 +80,16 @@
variable should be used to determine whether to execute rollback action or not and the action should modify the <code class="computeroutput"><span class="identifier">m_persons</span></code> object, not its copy. This is a most common case but passing a variable by
-      value is sometimes useful as well.
+ value is sometimes useful as well.<br>在上例中,变量 <code class="computeroutput"><span class="identifier">commit</span></code> 和 <code class="computeroutput"><span class="identifier">m_persons</span></code> 是以引用方式传递的,因为变量 <code class="computeroutput"><span class="identifier">commit</span></code> + 的最终值要用于决定是否执行回滚动作,且回滚动作要修改 <code class="computeroutput"><span class="identifier">m_persons</span></code> + 对象而不是它的拷贝。这是最常见的情况,不过以值方式传递变量有时也是有 用的。
     </p>
 <p>
Consider a more complex case where <code class="computeroutput"><span class="identifier">World</span><span class="special">::</span><span class="identifier">addPerson</span></code> can save intermediate states at some points and roll back to the last saved state. You can use <code class="computeroutput"><span class="identifier">Person</span><span class="special">::</span><span class="identifier">m_evolution</span></code> to store a version of changes - and increment it to cancel all rollback actions associated with those changes. + and increment it to cancel all rollback actions associated with those changes.<br>想象一个更复杂的情况,<code class="computeroutput"><span class="identifier">World</span><span class="special">::</span><span class="identifier">addPerson</span></code> + 可以在某些点上保存中间状态,并且可以回滚到最后保存的状态。你可以用 <code class="computeroutput"><span class="identifier">Person</span><span class="special">::</span><span class="identifier">m_evolution</span></code> 来保存变量的一个版本并对它进行递增,以取消与这些变化相关的所有回滚动作。
     </p>
 <p>
If you pass a current value of <code class="computeroutput"><span class="identifier">m_evolution</span></code>
@@ -95,13 +97,13 @@
by value, it will remain unchanged until the end of aa scope and you can compare it with the final value of the <code class="computeroutput"><span class="identifier">m_evolution</span></code>. If the latter wasn't incremented since you saved it, the rollback action inside
-      the block should be executed:
+ the block should be executed:<br>如果你以传值的方式来传递保存在 <code class="computeroutput"><span class="identifier">checkpoint</span></code> 变量中的 <code class="computeroutput"><span class="identifier">m_evolution</span></code> + 当前值,则直至 aa 作用域结束之前,它都会保持不变,你可以将它与 <code class="computeroutput"><span class="identifier">m_evolution</span></code> 的 最终值进行比较。如果后者在你保存之后未曾递增,则块中的回滚动作将被执行:
     </p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">World</span><span class="special">::</span><span class="identifier">addPerson</span><span class="special">(</span><span class="identifier">Person</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">aPerson</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">m_persons</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">aPerson</span><span class="special">);</span>

-    <span class="comment">// This block must be no-throw
-</span> <span class="identifier">Person</span><span class="special">&amp;</span> <span class="identifier">person</span> <span class="special">=</span> <span class="identifier">m_persons</span><span class="special">.</span><span class="identifier">back</span><span class="special">();</span> + <span class="comment">// This block must be no-throw 这一块必须无抛出 <br></span> <span class="identifier">Person</span><span class="special">&amp;</span> <span class="identifier">person</span> <span class="special">=</span> <span class="identifier">m_persons</span><span class="special">.</span><span class="identifier">back</span><span class="special">();</span> <span class="identifier">Person</span><span class="special">::</span><span class="identifier">evolution_t</span> <span class="identifier">checkpoint</span> <span class="special">=</span> <span class="identifier">person</span><span class="special">.</span><span class="identifier">m_evolution</span><span class="special">;</span>

<span class="identifier">BOOST_SCOPE_EXIT</span><span class="special">(</span> <span class="special">(</span><span class="identifier">checkpoint</span><span class="special">)(&amp;</span><span class="identifier">person</span><span class="special">)(&amp;</span><span class="identifier">m_persons</span><span class="special">)</span> <span class="special">)</span>
@@ -110,12 +112,10 @@
<span class="identifier">m_persons</span><span class="special">.</span><span class="identifier">pop_back</span><span class="special">();</span> <span class="special">}</span> <span class="identifier">BOOST_SCOPE_EXIT_END</span>

-    <span class="comment">// ...
-</span>
+    <span class="comment">// ...<br></span>
<span class="identifier">checkpoint</span> <span class="special">=</span> <span class="special">++</span><span class="identifier">person</span><span class="special">.</span><span class="identifier">m_evolution</span><span class="special">;</span>

-    <span class="comment">// Assign new id to the person
-</span> <span class="identifier">World</span><span class="special">::</span><span class="identifier">id_t</span> <span class="keyword">const</span> <span class="identifier">prev_id</span> <span class="special">=</span> <span class="identifier">person</span><span class="special">.</span><span class="identifier">m_id</span><span class="special">;</span> + <span class="comment">// Assign new id to the person 将新的 id 赋给 person<br></span> <span class="identifier">World</span><span class="special">::</span><span class="identifier">id_t</span> <span class="keyword">const</span> <span class="identifier">prev_id</span> <span class="special">=</span> <span class="identifier">person</span><span class="special">.</span><span class="identifier">m_id</span><span class="special">;</span> <span class="identifier">person</span><span class="special">.</span><span class="identifier">m_id</span> <span class="special">=</span> <span class="identifier">m_next_id</span><span class="special">++;</span> <span class="identifier">BOOST_SCOPE_EXIT</span><span class="special">(</span> <span class="special">(</span><span class="identifier">checkpoint</span><span class="special">)(&amp;</span><span class="identifier">person</span><span class="special">)(&amp;</span><span class="identifier">m_next_id</span><span class="special">)(</span><span class="identifier">prev_id</span><span class="special">)</span> <span class="special">)</span>
     <span class="special">{</span>
@@ -125,27 +125,25 @@
         <span class="special">}</span>
<span class="special">}</span> <span class="identifier">BOOST_SCOPE_EXIT_END</span>

-    <span class="comment">// ...
-</span>
+    <span class="comment">// ...<br></span>
<span class="identifier">checkpoint</span> <span class="special">=</span> <span class="special">++</span><span class="identifier">person</span><span class="special">.</span><span class="identifier">m_evolution</span><span class="special">;</span>
 <span class="special">}</span>
 </pre>
 <p>
- Full code listing can be found in <a href="../../../example/world.cpp" target="_top">world.cpp</a>. + Full code listing can be found in <a href="../../../example/world.cpp" target="_top">world.cpp</a>.<br>完整的代码 列表可以在 <a href="../../../example/world.cpp" target="_top">world.cpp</a> 找到。
     </p>
 </div>
-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tbody><tr>
 <td align="left"></td>
-<td align="right"><div class="copyright-footer">Copyright 2006 -2009 Alexander Nasonov<p> +<td align="right"><div class="copyright-footer">Copyright (c) 2006 -2009 Alexander Nasonov<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">
         http://www.boost.org/LICENSE_1_0.txt </a>)
       </p>
 </div></td>
-</tr></table>
+</tr></tbody></table>
 <hr>
 <div class="spirit-nav">
<a accesskey="p" href="../index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="alternatives.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
-</body>
-</html>
+</body></html>
\ No newline at end of file

Added: trunk/libs/scope_exit/example/world.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/scope_exit/example/world.cpp     Wed Apr  1 03:09:45 2009
@@ -0,0 +1,114 @@
+// Copyright Alexander Nasonov 2009
+//
+// 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)
+
+#include <vector>
+#include <ostream>
+
+#include <boost/foreach.hpp>
+#include <boost/scope_exit.hpp>
+
+// The following is required for typeof emulation mode:
+#include <boost/typeof/typeof.hpp>
+#include <boost/typeof/std/vector.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+class World;
+class Person
+{
+    friend class World;
+public:
+    typedef unsigned int id_t;
+    typedef unsigned int evolution_t;
+
+    Person()
+        : m_id(0)
+        , m_evolution(0)
+    {}
+
+    friend std::ostream& operator<<(std::ostream& o, Person const& p)
+    {
+        return o << "Person(" << p.m_id << ", " << p.m_evolution << ')';
+    }
+private:
+    id_t m_id;
+    evolution_t m_evolution;
+};
+
+BOOST_TYPEOF_REGISTER_TYPE(Person)
+
+class World
+{
+public:
+    typedef unsigned int id_t;
+
+    World()
+        : m_next_id(1)
+    {}
+    void addPerson(Person const& aPerson);
+
+    friend std::ostream& operator<<(std::ostream& o, World const& w)
+    {
+        o << "World(" << w.m_next_id << ", {";
+        BOOST_FOREACH(Person const& p, w.m_persons)
+        {
+             o << ' ' << p << ',';
+        }
+        return o << "})";
+    }
+private:
+    id_t m_next_id;
+    std::vector<Person> m_persons;
+};
+
+BOOST_TYPEOF_REGISTER_TYPE(World)
+
+void World::addPerson(Person const& aPerson) {
+    m_persons.push_back(aPerson);
+
+    // This block must be no-throw
+    Person& person = m_persons.back();
+    Person::evolution_t checkpoint = person.m_evolution;
+
+    BOOST_SCOPE_EXIT( (checkpoint)(&person)(&m_persons) )
+    {
+        if(checkpoint == person.m_evolution)
+            m_persons.pop_back();
+    } BOOST_SCOPE_EXIT_END
+
+    // ...
+
+    checkpoint = ++person.m_evolution;
+
+    // Assign new id to the person
+    World::id_t const prev_id = person.m_id;
+    person.m_id = m_next_id++;
+    BOOST_SCOPE_EXIT( (checkpoint)(&person)(&m_next_id)(prev_id) )
+    {
+        if(checkpoint == person.m_evolution) {
+            m_next_id = person.m_id;
+            person.m_id = prev_id;
+        }
+    } BOOST_SCOPE_EXIT_END
+
+    // ...
+
+    checkpoint = ++person.m_evolution;
+}
+
+#include <iostream>
+
+int main()
+{
+    Person adam, eva;
+    std::cout << adam << '\n';
+    std::cout << eva  << '\n';
+
+    World w;
+    w.addPerson(adam);
+    w.addPerson(eva);
+    std::cout << w << '\n';
+}
+

Other related posts:

  • » [boost-doc-zh commit] r233 - 完成 scope_exit 库文档翻译 - codesite-noreply