Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
64cd412
Update translation files
weblate May 13, 2026
7263137
Update translation files
weblate May 13, 2026
af68b12
Update translation files
weblate May 13, 2026
4c7773b
Update translation files
weblate May 13, 2026
e8390b5
Update translation files
weblate May 13, 2026
f256edf
Update translation files
weblate May 13, 2026
ff79d08
Update translation files
weblate May 13, 2026
bbad6c0
Update translation files
weblate May 13, 2026
3a3502e
Update translation files
weblate May 13, 2026
2055740
Update translation files
weblate May 13, 2026
1fd25d6
Update translation files
weblate May 13, 2026
fb06767
Update translation files
weblate May 13, 2026
c1564a7
Update translation files
weblate May 13, 2026
e7e1958
Update translation files
weblate May 13, 2026
89cb1f6
Update translation files
weblate May 13, 2026
b701d62
Update translation files
weblate May 13, 2026
b6592da
Update translation files
weblate May 13, 2026
79ace75
Update translation files
weblate May 13, 2026
5b709cd
Update translation files
weblate May 13, 2026
9494cec
Update translation files
weblate May 13, 2026
d98fc2c
Update translation files
weblate May 13, 2026
c753282
Update translation files
weblate May 13, 2026
e01db7b
Update translation files
weblate May 13, 2026
d66c344
Update translation files
weblate May 13, 2026
8d8c745
Update translation files
weblate May 13, 2026
80df57a
Update translation files
weblate May 13, 2026
d68bd21
Update translation files
weblate May 13, 2026
c1a129d
Update translation files
weblate May 13, 2026
328ec83
Update translation files
weblate May 13, 2026
eb3796e
Update translation files
weblate May 13, 2026
d8562cf
Update translation files
weblate May 13, 2026
c777e5c
Translated using Weblate (Chinese (Simplified Han script))
May 14, 2026
30b012a
Translated using Weblate (Chinese (Simplified Han script))
snowfox1003 May 14, 2026
f080d39
Translated using Weblate (Chinese (Simplified Han script))
May 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions doc/library-detail_zh_Hans.adoc
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
https://www.boost.org/doc/libs/release/libs/json/[image:https://raw.githubusercontent.com/CPPAlliance/json/master/doc/images/repo-logo-3.png[Boost.JSON]]
https://www.boost.org/doc/libs/release/libs/json/[image:https://raw.githubusercontent.com/CPPAlliance/json/master/doc/images/repo-logo-3.png[Boost.12312312312]]

[width="100%", cols="12%,43%,45%", options="header"]
[width="100%",cols="12%,43%,45%",options="header",]
|===
|分支 |https://github.com/boostorg/json/tree/master[`master`]
|Branch |https://github.com/boostorg/json/tree/master[`master`]
|https://github.com/boostorg/json/tree/develop[`develop`]
|https://azure.microsoft.com/en-us/services/devops/pipelines/[Azure]
|https://vinniefalco.visualstudio.com/json/_build/latest?definitionId=5&branchName=master[image:https://img.shields.io/azure-devops/build/vinniefalco/2571d415-8cc8-4120-a762-c03a8eda0659/8/master[构建状态]]
|https://vinniefalco.visualstudio.com/json/_build/latest?definitionId=8&branchName=develop[image:https://img.shields.io/azure-devops/build/vinniefalco/2571d415-8cc8-4120-a762-c03a8eda0659/8/develop[构建状态]]
|https://vinniefalco.visualstudio.com/json/_build/latest?definitionId=5&branchName=master[image:https://img.shields.io/azure-devops/build/vinniefalco/2571d415-8cc8-4120-a762-c03a8eda0659/8/master[Build
状态]] |https://vinniefalco.visualstudio.com/json/_build/latest?definitionId=8&branchName=develop[image:https://img.shields.io/azure-devops/build/vinniefalco/2571d415-8cc8-4120-a762-c03a8eda0659/8/develop[构建状态]]

|文档
|https://www.boost.org/doc/libs/master/libs/json/[image:https://img.shields.io/badge/docs-master-brightgreen.svg[文档]]
|https://www.boost.org/doc/libs/develop/libs/json/[image:https://img.shields.io/badge/docs-develop-brightgreen.svg[文档]]
|Docs
|https://www.boost.org/doc/libs/master/libs/json/[image:https://img.shields.io/badge/docs-master-brightgreen.svg[Documentation]]
|https://www.boost.org/doc/libs/develop/libs/json/[image:https://img.shields.io/badge/docs-develop-brightgreen.svg[Documentation]]

|https://drone.io/[Drone]
|https://drone.cpp.al/boostorg/json[image:https://drone.cpp.al/api/badges/boostorg/json/status.svg?ref=refs/heads/master[构建状态]]
|https://drone.cpp.al/boostorg/json[image:https://drone.cpp.al/api/badges/boostorg/json/status.svg?ref=refs/heads/develop[构建状态]]
|https://drone.cpp.al/boostorg/json[image:https://drone.cpp.al/api/badges/boostorg/json/status.svg?ref=refs/heads/master[Build
状态]] |https://drone.cpp.al/boostorg/json[image:https://drone.cpp.al/api/badges/boostorg/json/status.svg?ref=refs/heads/develop[构建状态]]

|测试矩阵
|http://www.boost.org/development/tests/master/developer/json.html[image:https://img.shields.io/badge/matrix-master-brightgreen.svg[测试矩阵]]
|http://www.boost.org/development/tests/develop/developer/json.html[image:https://img.shields.io/badge/matrix-develop-brightgreen.svg[测试矩阵]]
|Matrix
|http://www.boost.org/development/tests/master/developer/json.html[image:https://img.shields.io/badge/matrix-master-brightgreen.svg[Matrix]]
|http://www.boost.org/development/tests/develop/developer/json.html[image:https://img.shields.io/badge/matrix-develop-brightgreen.svg[Matrix]]

|模糊测试 |—
|https://github.com/boostorg/json/actions?query=workflow%3Afuzz+branch%3Adevelop[image:https://github.com/boostorg/json/workflows/fuzz/badge.svg?branch=develop[模糊测试]]
|Fuzzing |—
|https://github.com/boostorg/json/actions?query=workflow%3Afuzz+branch%3Adevelop[image:https://github.com/boostorg/json/workflows/fuzz/badge.svg?branch=develop[fuzz]]

|https://ci.appveyor.com/[Appveyor]
|https://ci.appveyor.com/project/vinniefalco/cppalliance-json/branch/master[image:https://ci.appveyor.com/api/projects/status/8csswcnmfm798203?branch=master&svg=true[构建状态]]
|https://ci.appveyor.com/project/vinniefalco/cppalliance-json/branch/develop[image:https://ci.appveyor.com/api/projects/status/8csswcnmfm798203?branch=develop&svg=true[构建状态]]
|https://ci.appveyor.com/project/vinniefalco/cppalliance-json/branch/master[image:https://ci.appveyor.com/api/projects/status/8csswcnmfm798203?branch=master&svg=true[Build
状态]] |https://ci.appveyor.com/project/vinniefalco/cppalliance-json/branch/develop[image:https://ci.appveyor.com/api/projects/status/8csswcnmfm798203?branch=develop&svg=true[构建状态]]

|https://codecov.io[codecov.io]
|https://codecov.io/gh/boostorg/json/branch/master[image:https://codecov.io/gh/boostorg/json/branch/master/graph/badge.svg[codecov]]
Expand Down Expand Up @@ -57,7 +57,8 @@ Boost.JSON 提供以下特性:
=== 要求

* 仅需 C++11
* 可链接预构建的静态或动态 Boost 库,也可使用纯头文件方式(见下文)。
* 可链接预构建的静态或动态 Boost 库,也可使用纯头文件方式
(见下文)
* Supports -fno-exceptions(可自动检测)

该库在其接口中大量依赖以下众所周知的 C++ 类型(以下称为 _standard types_):
Expand Down
6 changes: 3 additions & 3 deletions doc/pages/allocators/background_zh_Hans.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Official repository: https://github.com/boostorg/json
////

= 背景
C++中分配器的第一个版本定义了名为{req_Allocator}的要求,并将每个标准容器设计为以分配器类型为模板参数的类模板。例如,以下是 {std_vector} 的声明:
= 背景 C++中分配器的第一个版本定义了名为{req_Allocator}的要求,并将每个标准容器设计为以分配器类型为模板参数的类模板。例如,以下是 {std_vector} 的声明:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

# Check if the file exists and read lines around line 11
cat -n doc/pages/allocators/background_zh_Hans.adoc | head -20

Repository: CppDigest/json

Length of output: 796


Split the section heading from body text.

Line 11 incorrectly appends the explanatory sentence to the section heading. In AsciiDoc, the = heading syntax requires the title only on that line. The body text must start on a separate line after a blank line:

Fix
= 背景

C++中分配器的第一个版本定义了名为{req_Allocator}的要求,并将每个标准容器设计为以分配器类型为模板参数的类模板。例如,以下是 {std_vector} 的声明:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@doc/pages/allocators/background_zh_Hans.adoc` at line 11, The section heading
line currently contains both the title and body text; split them so the AsciiDoc
heading contains only "= 背景" and place the explanatory sentence
"C++中分配器的第一个版本定义了名为{req_Allocator}的要求,并将每个标准容器设计为以分配器类型为模板参数的类模板。例如,以下是
{std_vector} 的声明:" on the next line after a blank line, ensuring the heading and
body are separated per AsciiDoc rules.


[source]
----
Expand All @@ -28,9 +27,10 @@ include::../../../test/doc_background.cpp[tag=doc_background_2,indent=0]
* 容器必须是一个类模板。
* 在元素类型上参数化分配器的方式显得笨拙。
* 分配器特征机制(尤其是 POCCA 和 POCMA)复杂且容易出错。

使用多种分配器类型的基于分配器的程序会引发更多的函数模板实例化,且通常编译速度更慢,因为类模板的函数定义必须在所有调用点可见。

Allocator-based programs which use multiple allocator types incur a greater number of function template instantiations and are generally slower to compile because class template function definitions must be visible at all call sites.

== 多态分配器

{cpp}17通过引入一个名为 {ref_memory_resource} 的抽象接口来表示底层分配操作,从而改进分配器模型。该接口未在元素类型上参数化,且无特征:
Expand Down
4 changes: 1 addition & 3 deletions doc/pages/allocators/overview_zh_Hans.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Official repository: https://github.com/boostorg/json

:leveloffset: +1

include::background.adoc[]
include::storage_ptr.adoc[]
include::uses_allocator.adoc[]
include::background.adoc[] include::storage_ptr.adoc[] include::uses_allocator.adoc[]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

# First, check if the file exists and view its content around line 18
fd "overview_zh_Hans.adoc" -type f

Repository: CppDigest/json

Length of output: 229


🌐 Web query:

AsciiDoc include directive syntax multiple includes single line parsing

💡 Result:

The AsciiDoc (Asciidoctor) include directive does not support specifying multiple distinct target files in a single directive line. Each include::[] directive processes exactly one target file or URI.[1][2] To include content from multiple files, use separate include directives, one per line.[1] For example, to include chapters with separation: include::chapter01.adoc[] include::chapter02.adoc[] [1] For contiguous content (no extra blank lines), place them adjacent: include::attributes-settings.adoc[] include::attributes-urls.adoc[] [1] The directive syntax is a line-oriented expression: include::target[optional-attributes].[1][2] The target (single) may contain spaces but cannot start with one.[1] Within one file/target, you can include multiple portions using attributes: - Multiple line ranges: lines="1..10,15..20" (quoted commas) or lines=7;14..25 (semicolons).[3] - Multiple tags: tag=foo,bar (quoted) or tag=foo;bar.[4][5] Example: include::filename.txt[lines="1..10,15..20"] [3] No native support for globs/multiple-files-in-one-directive (core); requires extensions like glob-include-processor.[6] Official docs confirm the directive must be on its own line, parsing one target per directive.[1][2][7]

Citations:


🏁 Script executed:

# Search for similar patterns in the codebase to see if this is a common practice
rg "include::" --type adoc -A 1 -B 1 | head -100

Repository: CppDigest/json

Length of output: 87


🏁 Script executed:

# Find the file without type filter
fd "overview_zh_Hans.adoc"

Repository: CppDigest/json

Length of output: 215


🏁 Script executed:

# Alternative: search in doc directory
find . -name "*overview_zh_Hans*" -type f 2>/dev/null

Repository: CppDigest/json

Length of output: 223


🏁 Script executed:

# View the content around line 18
sed -n '15,22p' doc/pages/allocators/overview_zh_Hans.adoc

Repository: CppDigest/json

Length of output: 181


Split multiple include directives onto separate lines.

The AsciiDoc include directive must be one per line per the official Asciidoctor specification. Place each include:: directive on its own line to ensure proper parsing.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@doc/pages/allocators/overview_zh_Hans.adoc` at line 18, The single-line
AsciiDoc include directive currently combines three includes; split them so each
include:: directive is on its own line—replace the combined line with three
separate lines containing include::background.adoc[],
include::storage_ptr.adoc[], and include::uses_allocator.adoc[] respectively to
comply with Asciidoctor parsing rules.


:leveloffset: -1
38 changes: 24 additions & 14 deletions doc/pages/allocators/storage_ptr_zh_Hans.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,59 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Official repository: https://github.com/boostorg/json
////

= `storage_ptr`
本库中的可变长度容器均使用动态分配的内存来存储其内容。调用方可通过在特定构造函数和函数参数列表中指定 <<ref_storage_ptr>> ,以控制所使用的内存分配策略。<<ref_storage_ptr>> 具有以下特性:
= `storage_ptr` 本库中的可变长度容器均使用动态分配的内存来存储其内容。调用方可通过在特定构造函数和函数参数列表中指定 <<ref_storage_ptr>> ,以控制所使用的内存分配策略。<<ref_storage_ptr>> 具有以下特性:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

cd /repo && find . -name "storage_ptr_zh_Hans.adoc" -type f

Repository: CppDigest/json

Length of output: 114


🏁 Script executed:

git ls-files | grep -E "storage_ptr_zh_Hans.adoc"

Repository: CppDigest/json

Length of output: 104


🏁 Script executed:

cat -n doc/pages/allocators/storage_ptr_zh_Hans.adoc

Repository: CppDigest/json

Length of output: 6611


🏁 Script executed:

rg -n "Functions and Types" doc/pages/allocators/storage_ptr_zh_Hans.adoc

Repository: CppDigest/json

Length of output: 82


Split AsciiDoc section title and table blocks onto separate lines.

Line 11 merges a section title with paragraph text on the same line. Lines 17 and 63 mix table captions, delimiters, and content onto single lines instead of proper standalone block boundaries.

Correct formatting:

  • Line 11: Split the section title (= \storage_ptr``) onto its own line, followed by the paragraph
  • Line 17: Place .函数与类型, |===, and the header row on separate lines
  • Line 63: Move the closing |=== to its own line after the cell content
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@doc/pages/allocators/storage_ptr_zh_Hans.adoc` at line 11, The AsciiDoc
blocks are incorrectly merged; split the section title `= \`storage_ptr\`` onto
its own line followed by the paragraph, separate the table caption `.函数与类型`, the
table start delimiter `|===`, and the header row so each is on its own line, and
move the table closing delimiter `|===` onto its own line after the final cell
content to restore proper AsciiDoc block boundaries.


* 存储指针始终指向一个有效的、类型擦除后的 {ref_memory_resource}。
以下是使用该库时所有与分配相关的类型和函数列表:

* 默认构造的存储指针引用 <<default_memory_resource,default resource>>(默认资源),这是一个由实现定义的实例,始终使用等效于全局 operator new 和 operator delete 的方式。
.函数与类型 |=== |Name|描述

* 从 {ref_memory_resource} 或 {ref_polymorphic_allocator} 构造的存储指针不获取所有权;调用方负责确保资源的生命周期持续到不再被引用为止。
{ref_polymorphic_allocator} do not acquire ownership; the caller is responsible for ensuring that the lifetime of the resource extends until it is no longer referenced.

* 通过 <<ref_make_shared_resource>> 获取的存储指针会获得对内存资源的共享所有权;该资源的生命周期将延长,直至所有该存储指针的副本均被销毁。
ownership of the memory resource; the lifetime of the resource is extended until all copies of the storage pointer are destroyed.

* 存储指针在对资源进行类型擦除之前会记录 <<ref_is_deallocate_trivial>> 的值,从而允许在运行时查询该值。
before type-erasing the resource, allowing the value to be queried at run-time.

以下是使用该库时所有与分配相关的类型和函数列表:
This lists all of the allocation-related types and functions available when using the library:

.函数与类型
.Functions and Types
|===
|Name|描述
|Name|Description

| <<ref_get_null_resource>>
| 返回一个指向内存资源实例的指针,该实例在分配内存时总是抛出异常。此机制用于确保解析或容器操作不会进行动态内存分配,从而维持该不变性。
| Returns a pointer to a memory resource instance which always throws an
exception upon allocation. This is used to to achieve the invariant that no parsing or container operation will dynamically allocate memory.

| <<ref_is_deallocate_trivial>>
| 一个自定义点,允许内存资源类型表明其 deallocate 调用是平凡的。
| A customization point allowing a memory resource type to indicate that calls
to deallocate are trivial.

| <<ref_make_shared_resource>>
| 一个返回智能指针的函数,该智能指针对新分配的内存资源具有共享所有权。
| A function returning a smart pointer with shared ownership of a newly
allocated memory resource.

| {ref_memory_resource}
| 表示分配器的抽象基类。
| The abstract base class representing an allocator.

| <<ref_monotonic_resource>>
| 一种内存资源,用于分配大块内存,且其 deallocate 函数是平凡的。所分配的内存不会被释放,直到该资源被销毁,因此在解析场景下速度很快,但不适合执行修改操作。
| A memory resource which allocates large blocks of memory and has a trivial
deallocate function. Allocated memory is not freed until the resource is destroyed, making it fast for parsing but not suited for performing modifications.

| {ref_polymorphic_allocator}
| 一个 {req_Allocator},它通过引用 {ref_memory_resource} 执行内存分配。
| An {req_Allocator} which uses a reference to a {ref_memory_resource} to
perform allocations.

| <<ref_static_resource>>
| 一种使用调用方提供的单一缓冲区的内存资源,不进行任何动态分配。该资源在解析时速度很快,但不适合执行修改操作。
| A memory resource that uses a single caller provided buffer. No dynamic
allocations are used. This is fast for parsing but not suited for performing modifications.

| <<ref_storage_ptr>>
| 一种用于管理和访问 {ref_memory_resource} 的智能指针。
|===
| A smart pointer through which a {ref_memory_resource} is managed and
accessed. |===

== 默认内存资源
默认内存资源使用全局 `operator new` 和 `operator delete` 来进行内存分配。该资源不采用引用计数,且其 deallocate 函数是非平凡的。所有默认构造的 <<ref_storage_ptr>> 对象均引用同一个内存资源:
Expand Down
13 changes: 7 additions & 6 deletions doc/pages/allocators/uses_allocator_zh_Hans.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,29 @@ Official repository: https://github.com/boostorg/json
////

[#uses_allocator]
= 使用分配器构造
为支持已使用多态分配器的代码库,本库中的容器支持 {std_uses_allocator} 构造。对于 <<ref_array>>, <<ref_object>>, <<ref_string>> 和 <<ref_value>>:
= 使用分配器构造 为支持已使用多态分配器的代码库,本库中的容器支持 {std_uses_allocator} 构造。对于 <<ref_array>>, <<ref_object>>, <<ref_string>> 和 <<ref_value>>:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

cat -n doc/pages/allocators/uses_allocator_zh_Hans.adoc | head -30

Repository: CppDigest/json

Length of output: 1264


Fix AsciiDoc document structure for heading and bullet item.

Line 12 merges the section title with paragraph text on a single line, breaking AsciiDoc syntax. Lines 20–21 fragment the get_allocator bullet item, leaving it incomplete and separating an unrelated sentence.

Suggested fix
-= 使用分配器构造 为支持已使用多态分配器的代码库,本库中的容器支持 {std_uses_allocator} 构造。对于 <<ref_array>>, <<ref_object>>, <<ref_string>> 和 <<ref_value>>:
+= 使用分配器构造
+
+为支持已使用多态分配器的代码库,本库中的容器支持 {std_uses_allocator} 构造。对于 <<ref_array>>, <<ref_object>>, <<ref_string>> 和 <<ref_value>>:
...
-* 成员函数 `get_allocator` 返回一个
-库容器可以从多态分配器构造:
+* 成员函数 `get_allocator` 返回一个由容器所使用的 {ref_memory_resource} 构造的 {ref_polymorphic_allocator} 实例。
+
+库容器可以从多态分配器构造:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@doc/pages/allocators/uses_allocator_zh_Hans.adoc` at line 12, The AsciiDoc
heading and paragraph are merged and a bullet item for get_allocator is
fragmented; separate the section title from its paragraph so the heading line "=
使用分配器构造" stands alone followed by a blank line and then the paragraph that
mentions {std_uses_allocator} and the referenced types (<<ref_array>>,
<<ref_object>>, <<ref_string>>, <<ref_value>>); also fix the get_allocator
bullet by joining the broken lines into a single bullet entry for get_allocator
and move the unrelated sentence out of that bullet so the item reads as one
coherent line and the stray sentence becomes its own paragraph.


* 嵌套类型 `allocator_type` 是{ref_polymorphic_allocator}的别名。
由容器所使用的 {ref_memory_resource} 构造的 {ref_polymorphic_allocator} 实例。该内存资源的所有权不会被转移。

* 所有接受 <<ref_storage_ptr>> 的合格构造函数,也将在相同参数位置接受一个 {ref_polymorphic_allocator} 实例。
实际上,这意味着当库中的容器类型被用在使用多态分配器的标准容器中时,该分配器会传播到 JSON 类型。例如:

* 成员函数 `get_allocator` 返回一个
由容器所使用的 {ref_memory_resource} 构造的 {ref_polymorphic_allocator} 实例。该内存资源的所有权不会被转移。
库容器可以从多态分配器构造:

实际上,这意味着当库中的容器类型被用在使用多态分配器的标准容器中时,该分配器会传播到 JSON 类型。例如:
多态分配器会递归传播。子元素的子元素将使用与父元素相同的内存资源。

[source]
----
include::../../../test/doc_uses_allocator.cpp[tag=doc_uses_allocator_1,indent=0]
----

库容器可以从多态分配器构造:
Library containers can be constructed from polymorphic allocators:

[source]
----
include::../../../test/doc_uses_allocator.cpp[tag=doc_uses_allocator_2,indent=0]
----

多态分配器会递归传播。子元素的子元素将使用与父元素相同的内存资源。
The polymorphic allocator is propagated recursively. Child elements of child elements will use the same memory resource as the parent.
Loading