Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
663f076c
Unverified
Commit
663f076c
authored
Sep 19, 2018
by
Milo Yip
Committed by
GitHub
Sep 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1362 from jiapengwen/master
fix tutorial error
parents
2a5e733b
1cfa861d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
tutorial.zh-cn.md
doc/tutorial.zh-cn.md
+3
-2
No files found.
doc/tutorial.zh-cn.md
View file @
663f076c
...
...
@@ -294,7 +294,7 @@ Value a(kArrayType);
## 转移语义(Move Semantics) {#MoveSemantics}
在设计 RapidJSON 时有一个非常特别的决定,就是 Value 赋值并不是把来源 Value 复制至目的 Value,而是把
把
来源 Value 转移(move)至目的 Value。例如:
在设计 RapidJSON 时有一个非常特别的决定,就是 Value 赋值并不是把来源 Value 复制至目的 Value,而是把来源 Value 转移(move)至目的 Value。例如:
~~~
~~~~~~~cpp
Value a(123);
...
...
@@ -383,7 +383,8 @@ memset(buffer, 0, sizeof(buffer));
另外,上面的
`SetString()`
需要长度参数。这个 API 能处理含有空字符的字符串。另一个
`SetString()`
重载函数没有长度参数,它假设输入是空字符结尾的,并会调用类似
`strlen()`
的函数去获取长度。
最后,对于字符串字面量或有安全生命周期的字符串,可以使用 const-string 版本的
`SetString()`
,它没有 allocator 参数。对于字符串家面量(或字符数组常量),只需简单地传递字面量,又安全又高效:
最后,对于字符串字面量或有安全生命周期的字符串,可以使用 const-string 版本的
`SetString()`
,它没有
allocator 参数。对于字符串字面量(或字符数组常量),只需简单地传递字面量,又安全又高效:
~~~
~~~~~~~cpp
Value s;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment