Skip to content

Commit

Permalink
Merge pull request #15 from zhangyi1357/fixtypo
Browse files Browse the repository at this point in the history
fix typo for type_rich_api.md
  • Loading branch information
archibate authored Aug 2, 2024
2 parents 11abe50 + 5e0d1fe commit e1c2983
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/type_rich_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ read(32, buf, fd);
用户一样可以用一个根本不是文件句柄的臭整数来调用你,而得不到任何警告或报错:
```cpp
typedef FileHandle int;
typedef int FileHandle;
ssize_t read(FileHandle fd, char *buf, size_t len);
read(32, buf, fd); // 照样编译通过!
Expand Down Expand Up @@ -529,7 +529,7 @@ struct Span {
template <size_t N>
Span(std::array<char, N> &arr) : data(arr.data()), size(N) {}

Span(std::vector<charN> &vec) : data(vec.data()), size(vec.size()) {}
Span(std::vector<char> &vec) : data(vec.data()), size(vec.size()) {}

// 如果有需要,也可以显式写出 Span(buf, 30) 从首地址和长度构造出一个 Span 来
explicit Span(char *data, size_t size) : data(data), size(size) {}
Expand Down Expand Up @@ -1580,7 +1580,7 @@ public:
```

```cpp
struct Name : Typed<Name, T> {};
struct Name : Typed<Name, std::string> {};

struct Meter : Typed<Meter, double> {};

Expand Down

0 comments on commit e1c2983

Please sign in to comment.