[boost-doc-zh] r415 committed - 翻译 tr1 库的 qbk 文件

Revision: 415
Author: alai04
Date: Wed Jun 23 00:27:59 2010
Log: 翻译 tr1 库的 qbk 文件
http://code.google.com/p/boost-doc-zh/source/detail?r=415

Modified:
 /trunk/libs/tr1/doc/tr1.qbk

=======================================
--- /trunk/libs/tr1/doc/tr1.qbk Mon Dec 28 23:05:14 2009
+++ /trunk/libs/tr1/doc/tr1.qbk Wed Jun 23 00:27:59 2010
@@ -11,43 +11,53 @@
     [last-revision $Date: 2009-02-04 10:53:20 -0500 (Wed, 04 Feb 2009) $]
 ]

-[section:intro Introduction]
+[section:intro Introduction 简介]
The TR1 library provides an implementation of the C++ Technical Report on Standard Library Extensions. This library does not itself implement the TR1 components, rather it's a thin wrapper that will include your standard library's TR1 implementation (if it has one), otherwise it will include the Boost
-Library equivalents, and import them into namespace `std::tr1`.
+Library equivalents, and import them into namespace `std::tr1`.\n
+本 TR1 库提供了对关于标准库扩展的 C++ Technical Report 的一个实现。本库本身 并没有实现 TR1 的组件,而只是一个简单的包装器, +它包含了你的标准库的 TR1 实现(如果有),或者包含了 Boost 库中的等价物,并将 它们导入到名字空间 `std::tr1` 中。

 [endsect]

-[section:usage Usage]
+[section:usage Usage 用法]
 There are two things you need to decide before using the Boost.TR1 library:
whether to use your standard library's native TR1 implementation (if it has one),
-and which include style to use.
-
-[section:native Whether to use Your Native TR1 Library]
+and which include style to use.\n
+在使用 Boost.TR1 库之前,有两件事情你必须要决定:是否使用你的标准库中的原 生 TR1 实现(如果有的话),以及使用哪一种头文件包含风格。
+
+[section:native Whether to use Your Native TR1 Library 是否使用原生的TR1库]
 If your standard library implements the TR1, and you want to make
 use of it, rather than use the Boost equivalents, then you will need to
 take some explicit action to enable it: this may be a pre-processor
 define, a special compiler switch, or a different include path.
 You will need to consult your compilers documentation to find out
 which of these
-actions you need to take.
+actions you need to take.\n
+如果你的标准库实现了 TR1,而你也想使用它,而不是使用 Boost 的等价物,那么你 就需要一些动作来使用它: +这些动作可能是一个预处理器的定义,可能是一个特定的编译器开关,或者是一个不 同的包含路径。
+你需要查看你的编译器文档,找到你需要做的相应动作。

 Provided Boost is [link boost_tr1.config correctly configured],
 everything should
 now "just work", and code written to use Boost.TR1 will include
-your standard library's native headers rather than the Boost ones.
+your standard library's native headers rather than the Boost ones.\n
+已提供的 Boost 是 [link boost_tr1.config 正确配置的],所有东西都是"可以立即 使用"的,为使用
+Boost.TR1 所编写的代码将包含你的标准库中的原生头文件而不是 Boost 的头文件。

 [endsect]

-[section:include_style Header Include Style]
+[section:include_style Header Include Style 头文件包含风格]

 There are two ways you can include the Boost.TR1 headers,
-for example if you are interested in shared_ptr then you can either use:
+for example if you are interested in shared_ptr then you can either use:\n
+你有两种方法来包含 Boost.TR1 头文件,例如,如果你想用 shared_ptr,则你可以 写:

    #include <boost/tr1/memory.hpp>

-or:
+or:\n
+或者:

    #include <memory>

@@ -55,26 +65,34 @@
 to use.  The second option is standard-conforming, but requires that you
add `boost-install-path/boost/tr1/tr1` to your compiler's include search path.
 Note that you must not copy the headers in boost/tr1/tr1 into a directory
-called "include", doing so will cause them to cease working.
-
-[blurb [*Important Note #1]
+called "include", doing so will cause them to cease working.\n
+在其它 Boost 库中使用时,第一种方式是首选的方法。
+第二种方式则是符合标准的,不过要求你将 `boost-install-path/boost/tr1/tr1` 添加到你的编译器的头文件查找路径中。 +注意,你不能将 boost/tr1/tr1 中的头文件复制到 "include" 目录下,那样做会使 得它们无法工作。
+
+[blurb [*Important Note 重要说明 #1]

 The include path order is very important if you want this library to work
 correctly.  If you get compiler errors then suspect the include paths.  The
-correct order is:
+correct order is:\n
+包含路径的顺序是很重要的,如果你想这个库工作正常。如果你的编译出现错误则应 怀疑是否包含路径的原因。正确的顺序是:

 1) boost-root/boost/tr1/tr1\n
 2) boost-root\n
 3) Any other standard library replacements (STLport for example).\n
+   任何其它标准库的替代品(如 STLport)。\n
 4) Your regular standard library.\n
+   你的常规标准库。\n
 ]

-[blurb [*Important Note #2: GNU C++ Users]
-
-Normally this library should "just work" with the GNU C++ compiler.
+[blurb [*Important Note 重要说明 #2: GNU C++ Users]
+
+Normally this library should "just work" with the GNU C++ compiler.\n
+通常这个库是 "可以用于" GNU C++ 编译器的。

 However, if Boost is installed in `/usr/include` then you may get an error
-message of the form:
+message of the form:\n
+不过,如果 Boost 被安装在 `/usr/include` 路径下,则你可能会得到以下错误信 息:

 ``In file included from /usr/include/boost/tr1/tuple.hpp:5,
                  from boost-failure.cxx:1:
@@ -84,24 +102,30 @@
and if that doesn't work, define the macro `BOOST_TR1_GCC_INCLUDE_PATH` to the
 name of the directory containing gcc's include files: this is likely to be
 something like "g++-v4" but unfortunately varies from distribution
-to distribution.
+to distribution.\n
+这时请尝试在构建时定义宏 `BOOST_TR1_DISABLE_INCLUDE_NEXT`,如果还不能使 用,则将宏 `BOOST_TR1_GCC_INCLUDE_PATH`
+定义为 gcc 头文件所在的路径:这有点象 "g++-v4" 但是在各种发布间有所不同。
 ]

-[blurb [*Important Note #3: Borland C++ Users]
+[blurb [*Important Note 重要说明 #3: Borland C++ Users]

 Borland's compiler has a particularly broken form of `#include`, that
 will actually look for a file named `array.h` if you `#include <array>`.
 In order to make this library work with Borland's compiler you will need to
-set up the include paths as follows:
+set up the include paths as follows:\n
+Borland 的编译器具有特定的有问题的 `#include` 格式,如果你写 `#include <array>`,则它实际会查找名为 `array.h` 的文件。
+为了让本库可以用于 Borland 的编译器,你需要将包含路径设置如下:

 1) boost-root/boost/tr1/tr1/bcc32\n
 2) boost-root/boost/tr1/tr1\n
 3) boost-root\n
 4) Any other standard library replacements (STLport for example).\n
+   任何其它标准库的替代品(如 STLport)。\n
 5) Your regular standard library.\n
+   你的常规标准库。\n
 ]

-[blurb [*Important Note #4: Sun C++ Users]
+[blurb [*Important Note 重要说明 #4: Sun C++ Users]

 Sun's compiler has a particularly interesting form of `#include`, that
will actually look for a file named `array.SUNWCCh` if you `#include <array>`.
@@ -110,28 +134,36 @@
 In order to make this library work with Sun's compiler you can either
 pass the undocumented compiler switch ['"-Qoption ccfe -nosunwcch"] to
 the compiler, or else you will need to
-set up the include paths as follows:
+set up the include paths as follows:\n
+Sun 的编译器具有特别形式的 `#include`, 如果你写 `#include <array>`,则它实 际会查找名为 `array.SUNWCCh` 的文件。 +更重要的是它不会包含它认为已见到的标准头文件。为了让本库可以用于 Sun 的编译 器,你要么对编译器使用未公开的编译开关
+['"-Qoption ccfe -nosunwcch"],要么将包含路径设置如下:

 1) boost-root/boost/tr1/tr1/sun\n
 2) boost-root/boost/tr1/tr1\n
 3) boost-root\n
 4) Any other standard library replacements (STLport for example).\n
+   任何其它标准库的替代品(如 STLport)。\n
 5) Your regular standard library.\n
+   你的常规标准库。\n
 ]

 [endsect]

-[section:writing_code Writing Code]
+[section:writing_code Writing Code 编写代码]

 Regardless of how the includes are setup, user code written to work
 with Boost.TR1 is exactly the same as code written to use a native
 tr1 implementation.  That is, references to classes and functions
 need to explicitly use the `std::tr1` namespace or a `using std::tr1`
-statement.  For example,
+statement.  For example, \n
+无论如何设置头文件包含路径,编写使用 Boost.TR1 的用户代码与编写使用原生 tr1 实现的代码是一样的。 +即,对类和函数的引用必须显式使用 `std::tr1` 名字空间或 使用一个 `using std::tr1` 语句。例如:

    std::tr1::tuple<int, std::string> t = std::tr1::make_tuple(10, "hello");

-or
+or\n
+或

   using std::tr1;
   tuple<int, std::string> t = make_tuple(10, "hello");
@@ -142,12 +174,14 @@

 [endsect]

-[section:config Configuration]
+[section:config Configuration 配置]

 Configuring Boost.TR1 is no different to configuring any other part of
Boost; in the majority of cases you shouldn't actually need to do anything at all. However, because Boost.TR1 will inject Boost components into namespace std::tr1
-it is more than usually sensitive to an incorrect configuration.
+it is more than usually sensitive to an incorrect configuration.\n
+配置 Boost.TR1 和配置 Boost 的其它库没什么不同;多数情况下,你不需要做任何 动作。 +不过,由于 Boost.TR1 要将 Boost 组件注入到名字空间 std::tr1 中,所以它对于 不正确的配置通常会更为敏感。

 The intention is that
 [@../../libs/config/index.html Boost.Config]
@@ -155,10 +189,13 @@
 macros used by this library, so that if your standard library is set up to
support TR1 (note that few are at present) then this will be detected and Boost.TR1
 will use your standard library versions of these components rather than the
-Boost ones.
+Boost ones.\n
+我们的意图是,[@../../libs/config/index.html Boost.Config] 可以自动定义那些 本库要使用的配置宏,因此如果你的标准库是支持 +TR1 的(注意当前只有很少标准库可以),那么这会被检测出来且 Boost.TR1 会使用你 的标准库中的组件而不是使用 Boost 的。

If you would prefer to use the Boost versions of the TR1 conponents rather than
-your standard library, then either: include the Boost headers directly
+your standard library, then either: include the Boost headers directly\n
+如果你想使用 Boost 版本的 TR1 组件而不是标准库的,则要么直接包含 Boost 的头 文件:

    #include <boost/regex.hpp>

@@ -166,29 +203,34 @@

 Or else don't enable TR1 in your standard library: since TR1 is not part of
 the current standard, there should be some option to disable it in your
-compiler or standard library.
+compiler or standard library.\n
+要么在你的标准库中不要打开 TR1: 由于 TR1 不是当前标准的一部分,所以在你的编 译器或标准库中应该有选项来关闭它。

 The configuration macros used by each TR1 component are documented in each
 library section (and all together in the
 [@../../libs/config/index.html Boost.Config]
 documentation), but defining BOOST_HAS_TR1 will turn on native TR1 support
 for everything (if your standard library has it), which can act as a
-convenient shortcut.
-
-[blurb [*Note for gcc users]\n\n
+convenient shortcut.\n
+每个 TR1 组件所使用的配置宏在各自的章节进行介绍(并且全部收录在 [@../../libs/config/index.html Boost.Config] +的文档中),而定义 BOOST_HAS_TR1 将打开所有原生 TR1 的支持(如果你的标准库中 具备),这可以作为方便使用的方式。
+
+[blurb [*Note for gcc users 对于 gcc 用户的说明]\n\n
 Boost.TR1 does not currently enable gcc's native TR1 implementation
 as this is currently in an early stage of development.  However, you may
-choose to do so by defining BOOST_HAS_GCC_TR1.]
+choose to do so by defining BOOST_HAS_GCC_TR1.\n
+Boost.TR1 当前不能打开 gcc 的原生 TR1 实现,因为它尚处于开发的初期阶段。不 过,你可以通过定义 BOOST_HAS_GCC_TR1 来使用它。]

 [endsect]

-[section:subject_list TR1 By Subject]
-
-[section:ref Reference Wrappers.]
+[section:subject_list TR1 By Subject TR1 的分类]
+
+[section:ref Reference Wrappers. 引用包装器]

    #include <boost/tr1/functional.hpp>

-or
+or\n
+或

    #include <functional>

@@ -199,7 +241,9 @@
 and the two functions
 `ref` and `cref` that return
 instances of `reference_wrapper<T>`.
-[@../../doc/html/ref.html Refer to Boost.Bind for more information.]
+[@../../doc/html/ref.html Refer to Boost.Bind for more information.]\n
+Ref 库是一个小库,用于将引用传递给通常要对参数进行复制的函数模板(算法)。它 定义了类模板 `reference_wrapper<T>`, 以及返回 +`reference_wrapper<T>` 实例的两个函数 `ref` 和 `cref`. [@../../doc/html/ref.html 更多信息请参见 Boost.Bind.]

    namespace std {
    namespace tr1 {
@@ -214,25 +258,30 @@
    } // namespace tr1
    } // namespace std

-[*Configuration:]
+[*Configuration: ]
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_REFERENCE_WRAPPER if your
-standard library implements this part of TR1.
+standard library implements this part of TR1.\n
+[*配置:][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_REFERENCE_WRAPPER,如果你的标准库实现了这部分 TR1.

 [*Standard Conformity:]
 The Boost version of this this component does not currently support
 function call invocation (2.1.2.4), or derivation from std::unary_function
-or std::binary_function (2.1.2 paragraphs 3 and 4).
-
-The Boost version is not implicitly convertible to T& as the TR requires.
+or std::binary_function (2.1.2 paragraphs 3 and 4).\n
+[*标准符合性:]
+这一组件的 Boost 版本当前不支持函数调用(2.1.2.4),或是从 std::unary_function 或 std::binary_function 派生(2.1.2 第 3 段和第 4 段)。
+
+The Boost version is not implicitly convertible to T& as the TR requires.\n
+Boost 版本不能象 TR 要求的那样提供到 T& 的隐式转换。

 [endsect]

-[section:ptrs Smart Pointers.]
+[section:ptrs Smart Pointers. 智能指针]

    #include <boost/tr1/memory.hpp>

-or
+or\n
+或

    #include <memory>

@@ -241,7 +290,10 @@
 guaranteed to be deleted when the last `shared_ptr` pointing to it is
 destroyed or reset. For more information refer to the
 [@../../libs/smart_ptr/shared_ptr.htm shared_ptr]
-and [@../../libs/smart_ptr/weak_ptr.htm weak_ptr] documentation.
+and [@../../libs/smart_ptr/weak_ptr.htm weak_ptr] documentation.\n
+`shared_ptr` 类模板保存一个指向动态分配对象的指针,该对象通常是用 C++ 的 new-表达式得到的。 +当最后一个指向该对象的 `shared_ptr` 被销毁或重置时,将确保被指对象被删除。 更多信息,请参考 +[@../../libs/smart_ptr/shared_ptr.htm shared_ptr] 和 [@../../libs/smart_ptr/weak_ptr.htm weak_ptr] 的文档。

    namespace std {
    namespace tr1 {
@@ -289,10 +341,12 @@
 [*Configuration:]
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_SHARED_PTR if your
-standard library implements this part of TR1.
+standard library implements this part of TR1.\n
+[*配置:][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_SHARED_PTR,如果你的标准库实现了这部分 TR1.

[*Standard Conformity:] There are no known deviations from the standard when
-using the Boost version of this component.
+using the Boost version of this component.\n
+[*标准符合性:]使用该组件的 Boost 版本时,没有已知的与标准不符的地方。

 [endsect]

@@ -300,7 +354,8 @@

    #include <boost/tr1/functional.hpp>

-or
+or\n
+或

    #include <functional>

@@ -315,7 +370,11 @@
 the type `F` to be a function pointer,
 function reference, member function pointer, or class
 type.  For more information
-[@../../libs/utility/utility.htm#result_of refer to the Boost.Utility documentation.] +[@../../libs/utility/utility.htm#result_of refer to the Boost.Utility documentation.]\n +类模板 `result_of` 帮助确定函数调用表达式的类型。给定类型 `F` 的一个左值 `f` 以及类型分别为 `T1, T2, ..., TN` 的左值 +`t1, t2, ..., tN`, 类型 `result_of<F(T1, T2, ..., TN)>::type` 定义了表达式 `f(t1, t2, ...,tN)` 的结果类型。
+该实现允许类型 `F` 为函数指针、函数引用、成员函数指针或类类型。更多信息请
+[@../../libs/utility/utility.htm#result_of 参见 Boost.Utility 的文档]。

    namespace std {
    namespace tr1 {
@@ -332,9 +391,11 @@
 [*Configuration:]
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_RESULT_OF if your
-standard library implements this part of TR1.
-
-[*Standard Conformity:] No known problems.
+standard library implements this part of TR1.\n
+[*配置:][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_RESULT_OF,如果你的标准库实现了这部分 TR1.
+
+[*Standard Conformity:] No known problems.\n
+[*标准符合性:]没有已知的问题。

 [endsect]

@@ -342,7 +403,8 @@

    #include <boost/tr1/functional.hpp>

-or
+or\n
+或

    #include <functional>

@@ -353,7 +415,11 @@
also supports pointers to data members by treating them as functions taking no
 arguments and returning a (const) reference to the member.
 For more information refer to the [@../../libs/bind/mem_fn.html
-Boost.Mem_fn documentation].
+Boost.Mem_fn documentation].\n
+`std::tr1::mem_fn` 是标准函数 `std::mem_fun` 和 `std::mem_fun_ref` 的泛化。
+它支持多于一个参数的成员函数指针,且返回的函数对象可以以指向一个对象实例的 指针、引用或智能指针作为第一个参数。 +`mem_fn` 还支持数据成员指针,象不带参数的函数那样处理它们,返回该成员的一个 (const)引用。更多信息请参见
+[@../../libs/bind/mem_fn.html Boost.Mem_fn 的文档]。

    namespace std {
    namespace tr1 {
@@ -366,21 +432,25 @@
 [*Configuration:]
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_MEM_FN if your
-standard library implements this part of TR1.
+standard library implements this part of TR1.\n
+[*配置:][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_MEM_FN,如果你的标准库实现了这部分 TR1.

 [*Standard Conformity:]
 The Boost implementation does not produce functors that inherit from
 `std::unary_function` or `std::binary_function`, nor does it function
 correctly with pointers to volatile member functions (these should
-be extremely rare in practice however).
+be extremely rare in practice however).\n
+[*标准符合性:]Boost 的实现不生成继承自 `std::unary_function` 或 `std::binary_function` 的仿函数,也不能正确处理指向
+volatile 成员函数的指针(在实际上极为罕见)。

 [endsect]

-[section:bind Function Object Binders.]
+[section:bind Function Object Binders. 函数对象绑定器]

    #include <boost/tr1/functional.hpp>

-or
+or\n
+或

    #include <functional>

@@ -392,7 +462,11 @@
not need the `result_type`, `first_argument_type` and `second_argument_type`
 standard typedefs.
 For more information refer to the [@../../libs/bind/bind.html
-Boost.Bind documentation].
+Boost.Bind documentation].\n
+`std::tr1::bind` 是标准函数 `std::bind1st` 和 `std::bind2nd` 的泛化。
+它支持任意函数对象、函数、函数指针和成员函数指针,而且可以将任何参数绑定到 一个特定值或将输入的参数换到任意位置。 +`bind` 对函数对象没有任何要求;具体说,它不需要 `result_type`, `first_argument_type` 和 `second_argument_type` 等标准的 typedefs.
+更多信息请参见 [@../../libs/bind/bind.html Boost.Bind 的文档]。

    namespace std {
    namespace tr1 {
@@ -419,14 +493,17 @@
 [*Configuration:]
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_BIND if your
-standard library implements this part of TR1.
+standard library implements this part of TR1.\n
+[*配置:][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_BIND,如果你的标准库实现了这部分 TR1.

 [*Standard Conformity:]
The traits classes `is_placeholder` and `is_bind_expression` are not supported
-by the Boost implementation.
+by the Boost implementation.\n
+[*标准符合性:]在 Boost 实现中,不支持 traits 类 `is_placeholder` 和 `is_bind_expression`.

The named return value syntax isn't supported if the object being bound is a
-function pointer, for example:
+function pointer, for example:\n
+如果被绑定的对象是函数指针,则不支持命名返回值,例如:

    std::tr1::bind(&my_proc, arg1, arg2 /* etc */); // works OK.
std::tr1::bind<double>(&my_proc, arg1, arg2 /* etc */); // causes compiler error.
@@ -434,15 +511,17 @@

On the other hand, the Boost implementation does work with pointers to overloaded
 functions, and optionally with function pointers with non-standard
-calling conventions.
+calling conventions.\n
+另一方面,Boost 实现可以使用指向重载函数的指针,以及可选地支持非标准调用法 的函数指针。

 [endsect]

-[section:function Polymorphic function wrappers.]
+[section:function Polymorphic function wrappers. 多态函数包装器]

    #include <boost/tr1/functional.hpp>

-or
+or\n
+或

    #include <functional>

@@ -455,7 +534,11 @@
any callable object with a compatible call signature, this could be a function pointer, or it could be a function object produced by std::tr1::bind, or some other mechanism. For more information see the [@../../doc/html/function.html
-Boost.Function documentation].
+Boost.Function documentation].\n
+多态函数包装器是一族类模板,它们可用于泛型的回调机制。
+多态函数包装器共享了函数指针的特性,它们均定义了可被任意代码所调用的接口 (例如一个接受两个整型参数并返回一个浮点值的函数)。 +但是,多态函数包装器可以用兼容的调用符号来调用任何可调用对象,可能是函数指 针,或者是由 std::tr1::bind 或其它机制产生的函数对象。
+更多信息请参见 [@../../doc/html/function.html Boost.Function 的文档]。


    namespace std {
@@ -489,14 +572,17 @@
 [*Configuration:]
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_FUNCTION if your
-standard library implements this part of TR1.
+standard library implements this part of TR1.\n
+[*配置:][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_FUNCTION,如果你的标准库实现了这部分 TR1.

 [*Standard Conformity:]
 The Boost version of `std::tr1::function` lacks the member function
 `target_type()` and does not inherit from `std::unary_function`
 or `std::binary_function` when applicable. The member function
 target() can only access pointer-to-member targets when they
-have been wrapped in mem_fn.
+have been wrapped in mem_fn.\n
+标准符合性:Boost 版本的 `std::tr1::function` 缺少成员函数 `target_type()`,并且在使用时不是继承自 `std::unary_function` +或 `std::binary_function`. 当它们被包装在 mem_fn 中时,成员函数 target() 只 能访问成员指针目标。

 [endsect]

@@ -504,14 +590,17 @@

    #include <boost/tr1/type_traits.hpp>

-or
+or\n
+或

    #include <type_traits>

 Type traits enable generic code to access the fundamental properties
 of a type, to determine the relationship between two types, or to
 transform one type into another related type.  For more information
-refer to the [@../../libs/type_traits/index.html Boost.Type_traits documentation]. +refer to the [@../../libs/type_traits/index.html Boost.Type_traits documentation].\n +Type traits 使得泛型代码可以访问一个类型的基本属性,以决定两个类型之间的关 系,或者将一个类型转换为另一个相关类型。更多信息请参见
+[@../../libs/type_traits/index.html Boost.Type_traits 的文档]。

    namespace std {
    namespace tr1 {
@@ -598,18 +687,21 @@
 [*Configuration:]
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_TYPE_TRAITS if your
-standard library implements this part of TR1.
+standard library implements this part of TR1.\n
+[*配置:][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_TYPE_TRAITS,如果你的标准库实现了这部分 TR1.

 [*Standard Conformity:]
-No known problems.
+No known problems.\n
+[*标准符合性:]没有已知的问题。

 [endsect]

-[section:random Random Number Generators and Distributions.]
+[section:random Random Number Generators and Distributions. 随机数生成器和 分发]

    #include <boost/tr1/random.hpp>

-or
+or\n
+或

    #include <random>

@@ -621,7 +713,11 @@
 specific kind of distribution.  And the class template
 [@../../libs/random/random-variate.html variate_generator]
 which combines a generator with a distribution, to create a new generator.
-For more information see the [@../../libs/random/index.html Boost.Random documentation]. +For more information see the [@../../libs/random/index.html Boost.Random documentation].\n +随机数库分为三部分:[@../../libs/random/random-generators.html 生成器],它 是一些无参的函数对象,生成统一的随机数。 +[@../../libs/random/random-distributions.html 分发器],它也是一些无参的函数 对象,将生成器适配为特定种类的分发器。 +以及类模板 [@../../libs/random/random-variate.html variate_generator],它将 一个生成器和一个分配器进行组合,以创建一个新的生成器。
+更多信息请参见 [@../../libs/random/index.html Boost.Random 的文档]。


    namespace std {
@@ -769,24 +865,31 @@
 [*Configuration:]
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_RANDOM if your
-standard library implements this part of TR1.
+standard library implements this part of TR1.\n
+[*配置:][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_RANDOM,如果你的标准库实现了这部分 TR1.

 [*Standard Conformity:]
-The Boost implementation has the following limitations:
+The Boost implementation has the following limitations:\n
+[*标准符合性:]Boost 实现具有以下限制:

 *The linear_congruential generator is fully supported for
 signed integer types only (unsigned types probably only work when
-the modulus is zero).
-*The subtract_with_carry template does not support a modulus of zero.
+the modulus is zero).\n
+ linear_congruential 生成器只能完全支持有符号整数类型(无符号类型可能只能在 模数为零时使用)。
+*The subtract_with_carry template does not support a modulus of zero.\n
+ subtract_with_carry 模板不支持以零为模数。
*Not all of the standard generator types have Boost documentation yet, they are
-none the less supported however.
+none the less supported however.\n
+ 不是所有标准生成器都有 Boost 文档,不过它们仍被支持。
*Class template variate_generator does not have a template unary function call operator(),
-only the non-template nullary version.
+only the non-template nullary version.\n
+ 类模板 variate_generator 没有无参的模板函数调用操作符 operator(),只有非模 板的无参版本。

Note also that most of the Random number generators have been re-implemented
 as thin wrappers around the Boost versions in order to
provide a standard conforming interface (the Boost versions all take an additional, -redundant, template parameter, and are initialized by iterators rather than functors). +redundant, template parameter, and are initialized by iterators rather than functors).\n +还是注意,大多随机数生成器都重新实现了一个对 Boost 版本的小包装器,以提供符 合标准的接口(Boost 版本的生成器均带有一个额外的、多余的模板参数,而且是通过 迭代器而不是函数对象来初始化)。

 [endsect]

@@ -794,7 +897,8 @@

    #include <boost/tr1/tuple.hpp>

-or
+or\n
+或

    #include <tuple>

@@ -807,7 +911,12 @@
Some programming languages, such as ML, Python and Haskell, have built-in tuple constructs.
 Unfortunately C++ does not.
To compensate for this "deficiency", the TR1 Tuple Library implements a tuple construct using templates. -For more information see the [@../../libs/tuple/index.html Boost Tuple Library Documentation]. +For more information see the [@../../libs/tuple/index.html Boost Tuple Library Documentation].\n +tuple 是一个固定大小的元素集合。Pairs, triples, quadruples 等等都是 tuples. 在编程语言中,tuple 是一个以其它对象作为元素的数据对象。 +这些元素对象可以是不同的类型。Tuple 在许多环境下都很方便使用。例如,tuple 可以很容易地定义返回一个以上值的函数。 +有些编程语言,如 ML, Python 和 Haskell, 带有内建的 tuple 结构。不幸的是 C++ 没有。
+为了弥补这个"不足",TR1 Tuple 库用模板实现了一个 tuple 结构。更多信息请参见
+[@../../libs/tuple/index.html Boost Tuple 库的文档]。

    namespace std {
    namespace tr1 {
@@ -858,23 +967,27 @@
 [*Configuration:]
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_TUPLE if your
-standard library implements this part of TR1.
+standard library implements this part of TR1.\n
+[*配置:][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_TUPLE,如果你的标准库实现了这部分 TR1.

 [*Standard Conformity:]
-No known issues for conforming compilers.
+No known issues for conforming compilers.\n
+[*标准符合性:]在符合标准的编译器上没有已知的问题。

 [endsect]

-[section:utility Tuple Interface to std::pair.]
+[section:utility Tuple Interface to std::pair.  std::pair的tuple接口]

    #include <boost/tr1/utility.hpp>

-or
+or\n
+或

    #include <utility>

 The existing class template std::pair, can also be accessed using the
-[link boost_tr1.subject_list.tuple tuple interface].
+[link boost_tr1.subject_list.tuple tuple interface].\n
+已有的类模板 std::pair, 也可以通过 [link boost_tr1.subject_list.tuple tuple 接口] 来访问。

    namespace std {
    namespace tr1 {
@@ -894,18 +1007,21 @@
 [*Configuration:]
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_UTILITY if your
-standard library implements this part of TR1.
+standard library implements this part of TR1.\n
+[*配置:][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_UTILITY,如果你的标准库实现了这部分 TR1.

 [*Standard Conformity:]
-No known problems.
+No known problems.\n
+[*标准符合性:]没有已知的问题。

 [endsect]

-[section:array Fixed Size Array.]
+[section:array Fixed Size Array. 固定大小数组]

    #include <boost/tr1/array.hpp>

-or
+or\n
+或

    #include <array>

@@ -913,7 +1029,10 @@
 less efficient than a C style array.  Class array fulfils almost all of the
 requirements of a reversible-container (see Section 23.1,
[lib.container.requirements] of the C++ Standard). For more information refer
-to the [@../../libs/array/index.html Boost.Array documentation].
+to the [@../../libs/array/index.html Boost.Array documentation].\n
+类模板 array 是一个固定大小的数组,比C风格的数组更为安全且没有降低效率。
+类 array 几乎符合可逆容器(见C++标准的第 23.1节, [lib.container.requirements])的所有要求。
+更多信息请参见 [@../../libs/array/index.html Boost.Array 的文档]。

    namespace std {
    namespace tr1 {
@@ -946,18 +1065,21 @@
 [*Configuration:]
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_ARRAY if your
-standard library implements this part of TR1.
+standard library implements this part of TR1.\n
+[*配置:][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_ARRAY,如果你的标准库实现了这部分 TR1.

 [*Standard Conformity:]
-No known issues as of Boost-1.34 onwards.
+No known issues as of Boost-1.34 onwards.\n
+[*标准符合性:]没有 Boost-1.34 之前的已知问题。

 [endsect]

-[section:hash Hash Function Objects.]
+[section:hash Hash Function Objects. 散列函数对象]

    #include <boost/tr1/functional.hpp>

-or
+or\n
+或

    #include <functional>

@@ -966,7 +1088,9 @@
specializations of std::hash are provided for integer, character, floating point,
 and pointer types, plus the two string types std::string and std::wstring.
 See the [@../../libs/functional/hash/index.html Boost.Hash]
-documentation for more information.
+documentation for more information.\n
+类模板 std::hash 是一个单参函数对象,将某个类型 T 转换为一个散列值,对于整 数、字符、浮点数、指针类型,以及两个字符串类型 std::string +和 std::wstring 都已提供了 std::hash 的相应特化版本。更多信息请见 [@../../libs/functional/hash/index.html Boost.Hash] 的文档。

    namespace std {
    namespace tr1 {
@@ -1002,21 +1126,25 @@
 [*Configuration:]
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_HASH if your
-standard library implements this part of TR1.
+standard library implements this part of TR1.\n
+[*配置:][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_HASH,如果你的标准库实现了这部分 TR1.

 [*Standard Conformity:]
 Boost.Hash adds specialisations of std::hash for a wider range of types
 than those required by TR1: Boost.Hash acts as a testbed for issue 6.18
 in the [@http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
-Library Extension Technical Report Issues List].
+Library Extension Technical Report Issues List].\n
+[*标准符合性:]Boost.Hash 增加了比 TR1 更广范围的 std::hash 特化版 本:Boost.Hash 担当了 +[@http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf Library Extension Technical Report 问题列表] 中的问题 6.18 的测试床。

 [endsect]

-[section:regex Regular Expressions.]
+[section:regex Regular Expressions. 正则表达式]

    #include <boost/tr1/regex.hpp>

-or
+or\n
+或

    #include <regex>

@@ -1024,7 +1152,9 @@
including either iterator or string based matching, searching, search-and-replace, iteration, and tokenization. Both POSIX and ECMAScript (JavaScript) regular expressions are supported. For more information see the [@../../libs/regex/index.html
-Boost.Regex documentation].
+Boost.Regex documentation]. \n
+这个库提供了对正则表达式的全面支持,包括基于迭代器或字符串的匹配、查找、查 找并替换、迭代,以及分词 (tokenization)。 +支持 POSIX 和 ECMAScript (JavaScript)的正则表达式。更多信息请参见 [@../../libs/regex/index.html Boost.Regex 的文档]。

    namespace std {
    namespace tr1 {
@@ -1213,54 +1343,68 @@
 [*Configuration:]
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_REGEX if your
-standard library implements this part of TR1.
+standard library implements this part of TR1.\n
+[*配置:][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_REGEX,如果你的标准库实现了这部分 TR1.

 [*Standard Conformity:]
-No known problems.
+No known problems.\n
+[*标准符合性:]没有已知的问题。

 [endsect]

-[section:complex Complex Number Algorithm Overloads.]
+[section:complex Complex Number Algorithm Overloads. 复数算法重载]

    #include <boost/tr1/complex.hpp>

-or
+or\n
+或

    #include <complex>

 The following function templates have additional overloads:
-`arg`, `norm`, `conj`, `polar`, `imag`, and `real`.
+`arg`, `norm`, `conj`, `polar`, `imag`, and `real`.\n
+以下函数模板有新加的重载:`arg`, `norm`, `conj`, `polar`, `imag`, 和 `real`.

 The additional
-overloads are sufficient to ensure:
+overloads are sufficient to ensure:\n
+这些新增的重载函数足以确保:

 *If the argument has type `long double`, then the overload behaves as if
-the argument had been cast to `std::complex<long double>`.
+the argument had been cast to `std::complex<long double>`.\n
+如果参数类型为 `long double`, 则重载函数的行为就象这些参数已转型为 `std::complex<long double>` 一样。
 *Otherwise, if the argument has type `double` or is an integer type,
 then the overload behaves as if
-the argument had been cast to `std::complex<double>`.
+the argument had been cast to `std::complex<double>`.\n
+否则,如果参数类型为 `double` 或某个整数类型,则重载函数的行为就象这些参数 已转型为 `std::complex<double>` 一样。
 *Otherwise, if the argument has type `float`, then the overload
 behaves as if
-the argument had been cast to `std::complex<float>`.
+the argument had been cast to `std::complex<float>`.\n
+ 否则,如果参数类型为 `float`, 则重载函数的行为就象这些参数已转型为 `std::complex<float>` 一样。

 The function template `pow` has additional overloads sufficient to ensure,
-for a call with at least one argument of type `std::complex<T>`:
+for a call with at least one argument of type `std::complex<T>`:\n
+函数模板 `pow` 也有新增的重载可以确保,对于至少有一个参数类型为 `std::complex<T>` 的调用:

 *If either argument has type `complex<long double>` or type
 `long double`, then the overload behaves as if both arguments were cast
-to `std::complex<long double>`
+to `std::complex<long double>`\n
+ 如果参数类型为 `complex<long double>` 或 `long double`, 则重载函数的行为就 象两个参数均转型为 `std::complex<long double>` 一样。
 *Otherwise, if either argument has type `complex<double>`, `double`,
or an integer type, then the overload behaves as if both arguments were cast
-to `std::complex<double>`
+to `std::complex<double>`\n
+ 否则,如果参数类型为 `complex<double>`, `double`, 或某个整数类型,则重载函 数的行为就象两个参数均转型为 `std::complex<double>` 一样。
 *Otherwise, if either argument has type `complex<float>` or `float`,
 then the overload behaves as if both arguments were cast
-to `std::complex<float>`
+to `std::complex<float>`\n
+ 否则,如果参数类型为 `complex<float>` 或 `float`, 则重载函数的行为就象两个 参数均转型为 `std::complex<float>` 一样。

 In the following synopsis, `Real` is a floating point type,
 `Arithmetic` is an integer or floating point type, and `
 PROMOTE(X1 ... XN)` is the largest floating point type in the list
X1 to XN, after any non-floating point types in the list have been replaced by
-the type `double`.
+the type `double`.\n
+在以下摘要中,`Real` 为浮点类型,`Arithmetic` 为整数或浮点类 型,`PROMOTE(X1 ... XN)` 则是 X1 到 XN
+的最大浮点类型,其中所有非浮点类型均替换为类型 `double`.

    template <class Arithmetic>
    PROMOTE(Arithmetic) arg(const Arithmetic& t);
@@ -1296,18 +1440,22 @@
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_COMPLEX_OVERLOADS if your
 standard library implements the additional overloads for the existing
-complex arithmetic functions.
+complex arithmetic functions.\n
+[*配置:][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_COMPLEX_OVERLOADS,
+如果你的标准库实现了已有复数函数的额外重载。

 [*Standard Conformity:]
-No known problems.
+No known problems.\n
+[*标准符合性:]没有已知的问题。

 [endsect]

-[section:complex_trig Complex Number Additional Algorithms.]
+[section:complex_trig Complex Number Additional Algorithms. 其它复数算法]

    #include <boost/tr1/complex.hpp>

-or
+or\n
+或

    #include <complex>

@@ -1318,7 +1466,10 @@
 These algorithms are entirely
 classical, and behave as specified in the C99 standard section 7.3.5.
See the [@../../libs/math/doc/complex/html/complex_number_tr1_algorithms/inverse_complex.html
-Boost.Math documentation for more information].
+Boost.Math documentation for more information].\n
+算法 `acos`, `asin`, `atan`, `acosh`, `asinh`, `atanh` 和 `fabs` 均针对参数 类型 `std::complex<T>` 进行了重载。
+这些算法完全是正统的,其行为符合C99标准第7.3.5节中的规定。更多信息请参见
+[@../../libs/math/doc/complex/html/complex_number_tr1_algorithms/inverse_complex.html Boost.Math 的文档]。

    namespace std {
    namespace tr1 {
@@ -1337,18 +1488,22 @@
 [*Configuration:]
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG
-if your standard library implements the additional inverse trig functions.
+if your standard library implements the additional inverse trig functions.\n +[*配置:][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG,
+如果你的标准库实现了这些额外的反三角函数。

 [*Standard Conformity:]
-No known problems.
+No known problems.\n
+[*标准符合性:]没有已知的问题。

 [endsect]

-[section:unordered_set Unordered Associative Set (Hash Table).]
+[section:unordered_set Unordered Associative Set (Hash Table). 无序关联集合 (散列表)]

    #include <boost/tr1/unordered_set.hpp>

-or
+or\n
+或

    #include <unordered_set>

@@ -1358,16 +1513,22 @@
 lookup time has logarithmic complexity. That is generally okay,
 but in many cases a hash table can perform better, as accessing
 data has constant complexity, on average. The worst case complexity
-is linear, but that occurs rarely and with some care, can be avoided.
+is linear, but that occurs rarely and with some care, can be avoided.\n
+要基于键值查找来访问数据,C++ 标准库提供了 std::set, std::map, std::multiset 和 std::multimap。
+它们通常是用平衡二分树实现的,所以查找时间具有对数复杂度。
+这通常是OK的,但是在多数情况下,散列表可以表现得更好,因为平均来说它访问数 据具有常量时间复杂度。 +最坏情况下的复杂度是线性的,不过这极少发生,而且只要小心一点,是可以避免 的。

 With this in mind, the C++ Standard Library Technical Report
 introduced the unordered associative containers, which are
 implemented using hash tables, and they have now been added to
-the Working Draft of the C++ Standard.
+the Working Draft of the C++ Standard.  \n
+考虑到这一点,C++ 标准库技术报告引入了无序关联容器,用散列表来实现,而且现 在已经将它们增加到C++标准的工作草案中了。

 Refer to the
 [@../../libs/unordered/index.html Unordered Library docs]
-for more information.
+for more information.  \n
+更多信息就参考 [@../../libs/unordered/index.html Unordered 库文档]。

    namespace std {
    namespace tr1 {
@@ -1399,18 +1560,21 @@
 [*Configuration:]
 [@../../libs/config/index.html Boost.Config] should (automatically) define
 the macro BOOST_HAS_TR1_UNORDERED_SET if your
-standard library implements this part of TR1.
+standard library implements this part of TR1.\n
+[*配置: ][@../../libs/config/index.html Boost.Config] 会(自动)定义宏 BOOST_HAS_TR1_UNORDERED_SET 如果你的标准库实现了这部分的 TR1.

 [*Standard Conformity:]
-No known issues for conforming compilers.
+No known issues for conforming compilers.\n
+[*标准符合性:]对于符合标准的编译器,没有已知的问题。

 [endsect]

-[section:unordered_map Unordered Associative Map (Hash Table).]
+[section:unordered_map Unordered Associative Map (Hash Table). 无序关联映射 (散列表)]

    #include <boost/tr1/unordered_map.hpp>

-or
+or\n
+或

    #include <unordered_map>

@@ -1420,16 +1584,22 @@
 lookup time has logarithmic complexity. That is generally okay,
 but in many cases a hash table can perform better, as accessing
 data has constant complexity, on average. The worst case complexity
-is linear, but that occurs rarely and with some care, can be avoided.
+is linear, but that occurs rarely and with some care, can be avoided.\n
+要基于键值查找来访问数据,C++ 标准库提供了 std::set, std::map, std::multiset 和 std::multimap。
+它们通常是用平衡二分树实现的,所以查找时间具有对数复杂度。
+这通常是OK的,但是在多数情况下,散列表可以表现得更好,因为平均来说它访问数 据具有常量时间复杂度。 +最坏情况下的复杂度是线性的,不过这极少发生,而且只要小心一点,是可以避免 的。

***The diff for this file has been truncated for email.***

Other related posts:

  • » [boost-doc-zh] r415 committed - 翻译 tr1 库的 qbk 文件 - boost-doc-zh