File tree 2 files changed +6
-5
lines changed 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -500,7 +500,7 @@ int main() {
500
500
### 我用了 C++20 的函数参数 auto 语法糖
501
501
502
502
```cpp
503
- int generic_sum(std::vector<int> const &v, auto op) P
503
+ int generic_sum(std::vector<int> const &v, auto op) {
504
504
}
505
505
```
506
506
@@ -914,6 +914,7 @@ int hello(int x, int y) {
914
914
}
915
915
916
916
int main() {
917
+ auto hello2 = std::bind(hello, 2, std::placeholders::_1);
917
918
fmt::println("main 调用 hello2(3) 结果:{}", hello2(3));
918
919
fmt::println("main 调用 hello2(4) 结果:{}", hello2(4));
919
920
fmt::println("main 调用 hello2(5) 结果:{}", hello2(5));
Original file line number Diff line number Diff line change @@ -240,19 +240,19 @@ UTF-8 的构造就像一列小火车一样,不同范围内的码位会被编
240
240
乘客需要被拆分成三片,例如对于“我”这个乘客,“我”的码点是 0x6211,转换成二进制是:
241
241
242
242
```
243
- 110010000010001
243
+ 110001000010001
244
244
```
245
245
246
- 把乘客切分成高 4 位、中 6 位和低 6 位:
246
+ 把乘客切分成高 4 位、中 6 位和低 6 位(不足时在前面补零) :
247
247
248
248
```
249
- 1100 100000 10001
249
+ 0110 001000 010001
250
250
```
251
251
252
252
加上 ` 1110 ` 、` 10 ` 和 ` 10 ` 前缀后,形成一列火车:
253
253
254
254
```
255
- 11100110 10000010 10000001
255
+ 11100110 10001000 10010001
256
256
```
257
257
258
258
这样,我们就把“我”这个字符,编码成了三节列车,塞进字节流的网络隧道里了。
You can’t perform that action at this time.
0 commit comments