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

[Feature Request]: Add Heap.clear() Method #26229

Open
mdindoost opened this issue Nov 13, 2024 · 0 comments
Open

[Feature Request]: Add Heap.clear() Method #26229

mdindoost opened this issue Nov 13, 2024 · 0 comments

Comments

@mdindoost
Copy link

mdindoost commented Nov 13, 2024

Summary of Feature

Description:

I would like to request a feature addition to Chapel's Heap data structure: a clear() method. This method would allow users to efficiently clear an existing heap, removing all elements and resetting it to its initial state.

Use Case:
The clear() method would be useful in scenarios where the heap needs to be reused for multiple operations without reconstructing it entirely, improving code readability and potentially optimizing performance in iterative tasks.

Proposed Behavior:
Heap.clear() would empty all elements from the heap and reset it to its initial state, similar to how clear() functions are implemented in other data structures.

Thank you for considering this feature. It would enhance the flexibility of Heap and streamline code that requires frequent reinitialization of heaps.

Is this issue currently blocking your progress?

no

Code Sample

// Please provide source code that you'd like Chapel to support.
// You can insert your code inline if it's not too long.
// Otherwise, you can attach it as a file or provide a URL to it.
// To the extent possible, providing simplified programs demonstrating the
// problem will be appreciated.
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

2 participants