10000 ADT-String和Bit容器 | Inside Compiler · Issue #46 · inside-compiler/inside-compiler.github.io · GitHub
[go: up one dir, main page]

Skip to content

ADT-String和Bit容器 | Inside Compiler #46

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

Open
fiking opened this issue Mar 31, 2024 · 0 comments
Open

ADT-String和Bit容器 | Inside Compiler #46

fiking opened this issue Mar 31, 2024 · 0 comments

Comments

@fiking
Copy link
Collaborator
fiking commented Mar 31, 2024

https://inside-compiler.github.io/2024/03/16/ADT-StringBit/

StringADT中提供的字符串有一个典型的特点,通常不分配内存,而是公用内存。因此在使用ADT中相关的String类型,需要特别小心。 StringRefADT中提供的字符串类,这个类并不会针对的分配内存,它包含一个const char*和length分别表示指向的对字符串和长度。它和原始的字符串共享内存,因此StringRef大多数操作都是Immutable,即操作都是返回原始字符串的一个Co

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant
0