Repository navigation
fix: ebpps_sketch::merge(const&) called an unqualified swap - #557
Open
rustyconover wants to merge 1 commit into
Open
rustyconover wants to merge 1 commit into
rustyconover wants to merge 1 commit into
Conversation
The const& overload swapped with swap(*this, sk_copy), which only compiles when argument-dependent lookup finds a swap through the template arguments. With an allocator from an application's namespace it fails to compile. Call std::swap, as merge(&&) already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
ebpps_sketch::merge(const ebpps_sketch&)merges a heavier sketch, it swaps withswap(*this, sk_copy), unqualified. That only compiles when argument-dependent lookup finds aswapthrough the template arguments, as it does forstd::allocator. With an allocator from an application's namespace it fails:merge(ebpps_sketch&&)already callsstd::swap, so this does the same. I checked the other headers and found no other unqualifiedswapcalls.Test
Added
ebpps merge heavier sketch by const reference with an application allocatortoebpps_allocation_test.cpp. It uses an allocator declared outside thedatasketchesnamespace. Without the fix it doesn't compile; with it, all EBPPS tests pass (14 test cases).We found this in the DuckDB DataSketches extension, which builds its sketches with its own allocator. Until now it worked around this by copying the sketch and merging through
merge(&&).🤖 Generated with Claude Code