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

request: VecDeque #127

Open
beckend opened this issue Jan 26, 2024 · 3 comments
Open

request: VecDeque #127

beckend opened this issue Jan 26, 2024 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@beckend
Copy link

beckend commented Jan 26, 2024

  • Order matters
  • Possible to remove from any index and keep order.
  • Push and Pop front/back.
  • iter(), len()
@wvwwvwwv wvwwvwwv added the enhancement New feature or request label Jan 26, 2024
@wvwwvwwv
Copy link
Owner

wvwwvwwv commented Jan 26, 2024

That seems to be an interesting topic.

I've never thought about this, but I strongly feel that implementing a lock-free mt-safe version of std::collections::VecDeque is virtually impossible. However, I think I can provide something similar using Queue<T> if the second condition - Possible to remove from any index - can be relaxed or removed.

On the other hand, TreeIndex offers what you want except for the third condition - push/pop front/back.

  • Ordered.
  • Indexed operations.
  • Iter and len.

So, it maybe easier to extend TreeIndex instead of using Queue.

I'll think about this when I have time!

@wvwwvwwv wvwwvwwv added this to the SCC 3.0 milestone Aug 16, 2024
@TroyKomodo
Copy link

Is it possible to have a pop front/back on treeindex?

@wvwwvwwv
Copy link
Owner

Is it possible to have a pop front/back on treeindex?

Totally possible, and seems to be a good idea to emulate vecdeque!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants