<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.1" version="1.1">
  <file original="NoName" source-language="en" datatype="plaintext" target-language="zh_Hans">
    <body>
      <trans-unit xml:space="preserve" approved="no" id="4669b8ede1062a92" weblate-flags="safe-html, strict-same">
        <source>= Quick Look Here we highlight important features through example code to help convey the style of the interface. We begin by including the library header file which brings all the symbols into scope. Alternatively, individual headers may be included to obtain the declarations for specific types:</source>
        <target state="translated">= 快速浏览 这里我们通过示例代码重点介绍重要特性，以帮助理解接口风格。首先包含库头文件，该文件将所有符号引入作用域；或者，也可以包含单独的头文件以获取特定类型的声明：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">12</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="c2ac7c0e2b0250e2" weblate-flags="safe-html, strict-same">
        <source>In order to link your program you will need to link with a built library. Alternatively you can use the header-only configuration simply by including this header file in any __one__ of your new or existing source files:</source>
        <target state="translated">为链接程序，您需要链接已构建的库。或者，您可以使用仅需头文件（header-only）的配置，只需在任意__一个__新建或现有源文件中包含此头文件：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">23</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="87be6e03cbde7189" weblate-flags="safe-html, strict-same">
        <source>Values</source>
        <target state="translated">值</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">45</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="3ed70d1f83fa65b1" weblate-flags="safe-html, strict-same">
        <source>Say you want to recreate this JSON object in a container:</source>
        <target state="translated">假设您要在容器中重建一下 JSON 对象：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">46</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="a6fe4f7b78d8566e" weblate-flags="safe-html, strict-same">
        <source>In this library the types &lt;&lt;ref_array&gt;&gt;, &lt;&lt;ref_object&gt;&gt;, and &lt;&lt;ref_string&gt;&gt; hold JSON arrays, objects, and strings respectively while the type &lt;&lt;ref_value&gt;&gt; is a special variant which can hold any JSON element. Here we construct an empty object and then insert the elements above:</source>
        <target state="translated">在本库中，类型 &amp;lt;&lt;ref_array&gt;&amp;gt;、&amp;lt;&lt;ref_object&gt;&amp;gt; 和 &amp;lt;&lt;ref_string&gt;&amp;gt; 分别用于表示 JSON 数组、对象和字符串，而类型 &amp;lt;&lt;ref_value&gt;&amp;gt; 是一种特殊的变体（variant），可容纳任意 JSON 元素。以下示例首先构造一个空对象，然后插入上述元素：&lt;/ref_value&gt;&lt;/ref_string&gt;&lt;/ref_object&gt;&lt;/ref_array&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">66</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="4f21968abdf38cdf" weblate-flags="safe-html, strict-same">
        <source>While keys are strings, the mapped type of objects and the element type of arrays is the aforementioned type &lt;&lt;ref_value&gt;&gt; which can hold any JSON element, as seen in the previous assignments. Instead of building the JSON document using a series of function calls, we can build it in one statement using an initializer list:</source>
        <target state="translated">尽管键是字符串，但对象的映射类型和数组的元素类型均为前述的 &amp;lt;&lt;ref_value&gt;&amp;gt; 类型，它可以保存任意 JSON 元素，如前文赋值所示。除了通过一系列函数调用构建 JSON 文档外，我们还可以使用初始化列表在一条语句中完成构建：&lt;/ref_value&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">76</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="2e09c9deaa1066d9" weblate-flags="safe-html, strict-same">
        <source>When a &lt;&lt;ref_value&gt;&gt;, &lt;&lt;ref_array&gt;&gt;, or &lt;&lt;ref_object&gt;&gt; is assigned or constructed from an initializer list, the creation of the new value happens only once. This makes initializer lists equally efficient as using the other ways to create a value. The types in this library are first-class, supporting copy and move construction and assignment:</source>
        <target state="translated">当 &amp;lt;&lt;ref_value&gt;&amp;gt;, &amp;lt;&lt;ref_array&gt;&amp;gt;, 或 &amp;lt;&lt;ref_object&gt;&amp;gt; 通过初始化列表进行赋值或构造时，新值的创建仅发生一次。这使得初始化列表在效率上与其他创建值的方式相当。本库中的类型均为一等类型，支持复制和移动构造及赋值：&lt;/ref_object&gt;&lt;/ref_array&gt;&lt;/ref_value&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">87</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="4fe33c29b17646fd" weblate-flags="safe-html, strict-same">
        <source>Allocators</source>
        <target state="translated">分配器</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">99</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="62b100670639b878" weblate-flags="safe-html, strict-same">
        <source>To permit custom memory allocation strategies, these containers all allow construction with a &lt;&lt;ref_storage_ptr&gt;&gt; which is a smart pointer to a {ref_memory_resource}. The constructor signatures have the same ordering as their `std` equivalents which use {req_Allocator} parameters. Once a container is constructed its memory resource can never change. Here we create an array without performing any dynamic allocations:</source>
        <target state="translated">为支持自定义内存分配策略，这些容器均允许通过一个 &amp;lt;&lt;ref_storage_ptr&gt;&amp;gt;（指向 {ref_memory_resource} 的智能指针）进行构造。其构造函数签名的参数顺序与使用 {req_Allocator} 参数的标准库等价类型一致。容器一旦构造完成，其内存资源便不可更改。以下代码创建了一个未执行任何动态分配的数组：&lt;/ref_storage_ptr&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">100</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="ac101fdc4b8520d9" weblate-flags="safe-html, strict-same">
        <source>The containers in this library enforce the invariant that every element of the container will use the same memory resource:</source>
        <target state="translated">本库中的容器强制保持一个不变式：容器的每个元素都使用相同的内存资源：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">112</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="96781a2a99c85864" weblate-flags="safe-html, strict-same">
        <source>When a library type is used as the element type of a PMR container; that is, a container which uses a {ref_polymorphic_allocator}, the memory resource will automatically propagate to the type and all of its children:</source>
        <target state="translated">当库类型用作 PMR 容器（即使用 {ref_polymorphic_allocator} 的容器）的元素类型时，内存资源将自动传播至该类型及其所有子元素：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">120</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="9269123640406304" weblate-flags="safe-html, strict-same">
        <source>Up until now we have shown how values may be constructed from a memory resource pointer, where ownership is not transferred. In this case the caller is responsible for ensuring that the lifetime of the resource is extended for the life of the container. Sometimes you want the container to acquire shared ownership of the resource. This is accomplished with &lt;&lt;ref_make_shared_resource&gt;&gt;:</source>
        <target state="translated">截至目前，我们已展示如何通过内存资源指针（不转移所有权）构造值。此时调用方需确保资源生命周期覆盖容器的生命周期。有时您希望容器获取资源的共享所有权。这可通过 &amp;lt;&lt;ref_make_shared_resource&gt;&amp;gt; 实现：&lt;/ref_make_shared_resource&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">129</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="6a2cb55fc91f1d5a" weblate-flags="safe-html, strict-same">
        <source>A counted memory resource will not be destroyed until every container with shared ownership of the resource is destroyed.</source>
        <target state="translated">计数内存资源在拥有其共享所有权的每个容器均被销毁之前，是不会被销毁的。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">141</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="412e0e614e956dec" weblate-flags="safe-html, strict-same">
        <source>Parsing</source>
        <target state="translated">解析</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">145</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="a3f49bc34beee1ef" weblate-flags="safe-html, strict-same">
        <source>JSON can be parsed into the value container in one step using a free function. In the following snippet, a parse error is indicated by a thrown exception:</source>
        <target state="translated">可使用自由函数将 JSON 一步解析至值容器。在以下代码片段中，解析错误通过抛出异常指示：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">146</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="68167ff12a87fa7f" weblate-flags="safe-html, strict-same">
        <source>Error codes are also possible:</source>
        <target state="translated">也支持错误码：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">154</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="bc743a8f5428fe64" weblate-flags="safe-html, strict-same">
        <source>By default, the parser is strict and only accepts JSON compliant with the standard. However this behavior can be relaxed by filling out an options structure enabling one or more extensions. Here we use a static buffer and enable two non-standard extensions:</source>
        <target state="translated">默认情况下，解析器采用严格模式，仅接受符合标准的 JSON。但可通过填充一个选项结构体来启用一个或多个扩展，从而放宽此行为。以下示例使用静态缓冲区并启用了两个非标准扩展：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">161</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="df85190f53a9d275" weblate-flags="safe-html, strict-same">
        <source>The parser in this library implements a https://en.wikipedia.org/wiki/Online_algorithm[__streaming algorithm__]; it can process JSON piece-by-piece, without the requirement that the entire input is available from the start. The parser uses a temporary memory allocation to do its work. If you plan on parsing multiple JSONs, for example in a network server, keeping the same parser instance will allow re-use of this temporary storage, improving performance.</source>
        <target state="translated">本库中的解析器实现了一种 https://en.wikipedia.org/wiki/Online_algorithm[__streaming algorithm__]（流式算法）；它可逐段处理 JSON，无需从一开始就提供完整输入。解析器在工作时会使用临时内存分配。如果计划解析多个 JSON（例如在网络服务器中），复用同一个解析器实例可以重用该临时存储，从而提升性能。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">171</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="0d380421d0aaf157" weblate-flags="safe-html, strict-same">
        <source>With strategic use of the right memory resources, parser instance, and calculated upper limits on buffer sizes, it is possible to parse and examine JSON without __any__ dynamic memory allocations. This is explored in more detail in a later section.</source>
        <target state="translated">通过合理使用适当的内存资源、解析器实例及缓冲区大小的计算上限，可在不进行__任何__动态内存分配的情况下解析和检查 JSON。后续章节将对此进行更详细探讨。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">184</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="e1f0e7970f161537" weblate-flags="safe-html, strict-same">
        <source>Serializing</source>
        <target state="translated">序列化</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">190</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="db643e800a3a83ff" weblate-flags="safe-html, strict-same">
        <source>Simple free functions are provided for serializing a &lt;&lt;ref_value&gt;&gt; to a {std_string} containing JSON:</source>
        <target state="translated">提供了简单的自由函数，用于将 &amp;lt;&lt;ref_value&gt;&amp;gt; 序列化为包含 JSON 的 {std_string}：&lt;/ref_value&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">191</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="f017a096ebaa98c8" weblate-flags="safe-html, strict-same">
        <source>The serializer in this library implements a https://en.wikipedia.org/wiki/Online_algorithm[__streaming algorithm__]; it can output JSON a piece at a time, without the requirement that the entire output area is allocated at once:</source>
        <target state="translated">本库中的序列化器实现了 https://en.wikipedia.org/wiki/Online_algorithm[__streaming algorithm__]（流式算法）；它可逐段输出 JSON，无需一次性分配整个输出空间：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">199</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="0e182a16fc91bfa4" weblate-flags="safe-html, strict-same">
        <source>Value Conversion</source>
        <target state="translated">值转换</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">210</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="c05ad7bc0cbe4959" weblate-flags="safe-html, strict-same">
        <source>Given a user-defined type:</source>
        <target state="translated">给定一个用户定义的类型：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">211</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="146e8491b8568c9c" weblate-flags="safe-html, strict-same">
        <source>We can define a conversion from the user-defined type to a &lt;&lt;ref_value&gt;&gt; by defining an overload of `tag_invoke` in the same namespace. This maps `customer` to a JSON object:</source>
        <target state="translated">我们可在同一命名空间中定义 `tag_invoke` 的重载，来实现从用户定义类型到 &amp;lt;&lt;ref_value&gt;&amp;gt; 的转换。此操作将 `customer` 映射为 JSON 对象：&lt;/ref_value&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">218</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="baede733f4302468" weblate-flags="safe-html, strict-same">
        <source>This allows us to use the library function &lt;&lt;ref_value_from&gt;&gt; to produce a &lt;&lt;ref_value&gt;&gt; from our type:</source>
        <target state="translated">这允许我们可以使用库函数 &amp;lt;&lt;ref_value_from&gt;&amp;gt; 从我们的类型生成一个 &amp;lt;&lt;ref_value&gt;&amp;gt;：&lt;/ref_value&gt;&lt;/ref_value_from&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">227</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="cfdf3830b2da3395" weblate-flags="safe-html, strict-same">
        <source>The library knows what to do with standard containers. Here we convert an array of customers to a value:</source>
        <target state="translated">该库能够自动处理标准容器。以下我们将一个客户数组转换为一个值：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">235</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="8bafac4ebc3cf67f" weblate-flags="safe-html, strict-same">
        <source>To go from JSON to a user-defined type we use &lt;&lt;ref_value_to&gt;&gt;, which uses another overload of `tag_invoke`. This converts a JSON value to a `customer`. It throws an exception if the contents of the value do not match what is expected:</source>
        <target state="translated">为将 JSON 转换为用户定义类型，我们使用 &amp;lt;&lt;ref_value_to&gt;&amp;gt;（它会调用 `tag_invoke` 的另一个重载）。此操作将 JSON 值转换为 `customer`。若值内容不符合预期，则抛出异常：&lt;/ref_value_to&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">243</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="1b241780115bb4f5" weblate-flags="safe-html, strict-same">
        <source>The code above defines the convenience function `extract`, which deduces the types of the struct members. This works, but requires that the struct is {req_DefaultConstructible}. An alternative is to construct the object directly, which is a little more verbose but doesn't require default construction:</source>
        <target state="translated">上述代码定义了便捷函数 `extract`，它能推导结构体成员的类型。这种方式可行，但要求该结构体是 {req_DefaultConstructible}。另一种方法是直接构造对象，虽然略显冗长，但无需默认构造：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">253</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="f317521bfde5b747" weblate-flags="safe-html, strict-same">
        <source>Now we can construct customers from JSON:</source>
        <target state="translated">现在我们可以从 JSON 构造客户对象（customer）：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">263</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="5695d334ae48e7b7" weblate-flags="safe-html, strict-same">
        <source>The library's generic algorithms recognize when you are converting a &lt;&lt;ref_value&gt;&gt; to a container which resembles an array or object, so if you wanted to turn a JSON array into a vector of customers you might write:</source>
        <target state="translated">当将 &amp;lt;&lt;ref_value&gt;&amp;gt; 转换为类似数组或对象的容器时，库的通用算法可自动识别。因此若要将 JSON 数组转换为客户向量，可编写如下代码：&lt;/ref_value&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">270</context>
        </context-group>
      </trans-unit>
    </body>
  </file>
</xliff>
