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

Unable to override swap function call in append_child #25

Open
rp999 opened this issue Apr 25, 2024 · 0 comments
Open

Unable to override swap function call in append_child #25

rp999 opened this issue Apr 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@rp999
Copy link

rp999 commented Apr 25, 2024

iter tree<T, tree_node_allocator>::append_child(iter position, T&& x) contains std::swap(tmp->data, x); which enforces the use of std::swap. In my instance I needed to control how the data fields are swapped based on information they contain.
By changing the std::swap call to these 2 statements, I can provide an override swap function:
using std::swap;
swap(tmp->data, x);
If no override function is provided, the default std::swap is used.

@kpeeters kpeeters added the enhancement New feature or request label Jul 19, 2024
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

2 participants