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

list: add features from frg::intrusive_list to frg::list #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rdmsr
Copy link

@rdmsr rdmsr commented Jul 13, 2023

I added feature parity between frg::list and its backing frg::intrusive_list.

The only "issue" which may be unexpected is that ->object is required to access the underlying object when doing a range-based for loop:

frg::list<int, allocator> list{};
list.push_back(1);

for(auto elem : list) {
   std::cout << elem->object; << std::endl; // prints 1
}

@qookei
Copy link
Member

qookei commented Jul 13, 2023

I'd probably be better to implement an iterator type that directly returns the list item and not the intrusive list wrapper type, since that's an implementation detail.

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