Skip to content
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

Update version to 0.2.1 #2

Merged
merged 2 commits into from
Oct 28, 2024
Merged

Update version to 0.2.1 #2

merged 2 commits into from
Oct 28, 2024

Conversation

guoweikang
Copy link
Contributor

1 linked list support push_front API
2 RawList as a public type

--------
Implementing push_front in a circular doubly linked list is
very simple. It behaves the same as pushback, and only requires
updating the head.

Signed-off-by: guoweikang <[email protected]>
@guoweikang guoweikang force-pushed the guoweikang/add_push_front branch from 2c64a91 to 8bfa6fc Compare October 28, 2024 06:06
-------
1 update to 0.2.1
2 RawList as a public type

Signed-off-by: guoweikang <[email protected]>
@guoweikang guoweikang force-pushed the guoweikang/add_push_front branch from 8bfa6fc to f5d3aa1 Compare October 28, 2024 06:08
@equation314
Copy link
Member

What's the difference between List and RawList?

@guoweikang
Copy link
Contributor Author

What's the difference between List and RawList?

Actually, this question should not be answered by me, it is entirely the code contributed by the developers of r4l;
Let me try to answer this: RawList encapsulates the raw linked list structure in the form of NonNull<T> , NonNull is generated from &T。
In actual use, we do not recommend using RawList and &T directly, unless in specific circumstances, otherwise unsafe and &T may have various life cycle problems.

List is a wrapper of RawList, but its interface is safe because the type is required to implement LinksWrapped (actually, only Box<T> and Arc<T> implement it now). The smart pointer guarantees the life cycle of the internal RawList reference, which is safe.

@equation314 equation314 merged commit 353828c into main Oct 28, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants