Skip to content

fix typo #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions book/en-us/00-preface.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ order: 0

## Introduction

C++ user group is a fairly large. From the advent of C++98 to the official finalization of C++11, it has accumulated over a decade. C++14/17 is an important complement and optimization for C++11, and C++20 brings this language to the door of modernization. The extended features of all these new standards are given to the C++ language. Infused with new vitality.
C++ user group is fairly large. From the advent of C++98 to the official finalization of C++11, it has accumulated over a decade. C++14/17 is an important complement and optimization for C++11, and C++20 brings this language to the door of modernization. The extended features of all these new standards are given to the C++ language. Infused with new vitality.
C++ programmers, who are still using **traditional C++** (this book refers to C++98 and its previous C++ standards as traditional C++), may even amazed by the fact that they are not using the same language while reading modern C++ code.

**Modern C++** (this book refers to C++11/14/17/20) introduces a lot of features into traditional C++, which makes the whole C++ become language that modernized. Modern C++ not only enhances the usability of the C++ language itself, but the modification of the `auto` keyword semantics gives us more confidence in manipulating extremely complex template types. At the same time, a lot of enhancements have been made to the language runtime. The emergence of Lambda expressions has made C++ have the "closure" feature of "anonymous functions", which is almost in modern programming languages ​​(such as Python/Swift/.. It has become commonplace, and the emergence of rvalue references has solved the problem of temporary object efficiency that C++ has long been criticized.
Expand All @@ -31,7 +31,7 @@ In conclusion, as an advocate and practitioner of C++, we always maintain an ope

The book claims "On the Fly". Its intent is to provide a comprehensive introduction to the relevant features regarding modern C++ (before 2020s).
Readers can choose interesting content according to the following table of content to learn and quickly familiarize the new features you would like to learn.
Readers should aware that all of these features are not required. It should be leart when you really need it.
Readers should aware that all of these features are not required. It should be learnt when you really need it.

At the same time, instead of grammar-only, the book introduces the historical background as simple as possible of its technical requirements, which provides great help in understanding why these features comes out.

Expand Down
2 changes: 1 addition & 1 deletion book/en-us/01-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ You should first compile the C code with `gcc`:
gcc -c foo.c
```

Compile and output the `foo.o` file, and link the C++ code to the `.o` file using `clang++` (or both compile to `.o` and then unlink them together):
Compile and output the `foo.o` file, and link the C++ code to the `.o` file using `clang++` (or both compile to `.o` and then link them together):

```bash
clang++ 1.1.cpp foo.o -std=c++2a -o 1.1
Expand Down
4 changes: 2 additions & 2 deletions book/en-us/03-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ through copy constructors and assignment operators,
but in order to implement the movement of resources,
The caller must use the method of copying and then destructing first,
otherwise you need to implement the interface of the mobile object yourself.
Imagine moving to move your home directly to your new home instead of
Imagine moving your home directly to your new home instead of
copying everything (rebuy) to your new home.
Throwing away (destroying) all the original things is a very anti-human thing.

Expand Down Expand Up @@ -607,7 +607,7 @@ constexpr _Tp&& forward(typename std::remove_reference<_Tp>::type&& __t) noexcep
```

In this implementation, the function of `std::remove_reference` is to eliminate references in the type.
And `std::is_lvalue_reference` is used to check if the type derivation is correct, in the second implementation of `std::forward`
And `std::is_lvalue_reference` is used to check if the type derivation is correct, in the second implementation of `std::forward`.
Check that the received value is indeed an lvalue, which in turn reflects the collapse rule.

When `std::forward` accepts an lvalue, `_Tp` is deduced to the lvalue, so the return value is the lvalue; and when it accepts the rvalue,
Expand Down
4 changes: 2 additions & 2 deletions book/en-us/07-thread.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ int main() {
}
```

Of course, not all types provide atomic operations because the feasibility of atomic operations depends on the architecture of the CPU and whether the type structure being instantiated satisfies the memory alignment requirements of the architecture, so we can always pass Std::atomic<T>::is_lock_free` to check if the atom type needs to support atomic operations, for example:
Of course, not all types provide atomic operations because the feasibility of atomic operations depends on the architecture of the CPU and whether the type structure being instantiated satisfies the memory alignment requirements of the architecture, so we can always pass `std::atomic<T>::is_lock_free` to check if the atom type needs to support atomic operations, for example:

```cpp
#include <atomic>
Expand Down Expand Up @@ -366,7 +366,7 @@ Weakening the synchronization conditions between processes, usually we will cons
x.store(2)
```

Under the order consistency requirement, `x.load()` must read the last written data, so `x.store(2)` and `x.store(1)` do not have any guarantees, ie As long as ``x.store(2)` of `T2` occurs before `x.store(3)`.
Under the order consistency requirement, `x.load()` must read the last written data, so `x.store(2)` and `x.store(1)` do not have any guarantees, ie As long as `x.store(2)` of `T2` occurs before `x.store(3)`.

3. Causal consistency: its requirements are further reduced, only the sequence of causal operations is guaranteed, and the order of non-causal operations is not required.

Expand Down
4 changes: 2 additions & 2 deletions book/en-us/09-others.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ the external will not trigger. For instance:
try {
may_throw();
} catch (...) {
std::cout << "exception captured from my_throw()" << std::endl;
std::cout << "exception captured from may_throw()" << std::endl;
}
try {
non_block_throw();
Expand All @@ -100,7 +100,7 @@ try {
The final output is:

```
exception captured, from my_throw()
exception captured, from may_throw()
exception captured, from non_block_throw()
```

Expand Down
6 changes: 3 additions & 3 deletions website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.