Skip to content

Conversation

kongyuanchao
Copy link

Summary

This PR fixes the swap function implementation in KdtreeBoundingBoxNearestNeighbors by updating the swapped member variables to match the actual class members.

Changes
Before (incorrect swap members):
swap(this->mean, other.mean);
swap(this->metric, other.metric);
swap(this->samples, other.samples);
swap(this->root, other.root);
swap(this->values, other.values);
swap(this->var, other.var);

After (corrected to existing class members):
swap(this->boundingBox, other.boundingBox);
swap(this->metric, other.metric);
swap(this->checks, other.checks);
swap(this->root, other.root);
swap(this->values, other.values);
swap(this->nodeDataMax, other.nodeDataMax);

Reason
The previous implementation attempted to swap non-existent or outdated members (mean, samples, var), leading to build errors such as:

error: 'class rl::math::KdtreeBoundingBoxNearestNeighbors' has no member named 'var'
This PR corrects that by aligning the swapped fields with the actual member variables of the class.

Environment Tested
Windows 11 / Git Bash
GCC via MSYS2 / MinGW64

Manual build successful after fix

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.

1 participant