rustyconover opened a new pull request, #557:
URL: https://github.com/apache/datasketches-cpp/pull/557

   When `ebpps_sketch::merge(const ebpps_sketch&)` merges a heavier sketch, it 
swaps with `swap(*this, sk_copy)`, unqualified. That only compiles when 
argument-dependent lookup finds a `swap` through the template arguments, as it 
does for `std::allocator`. With an allocator from an application's namespace it 
fails:
   
   ```
   ebpps_sketch_impl.hpp:205:9: error: 'swap' was not declared in this scope
   ```
   
   `merge(ebpps_sketch&&)` already calls `std::swap`, so this does the same. I 
checked the other headers and found no other unqualified `swap` calls.
   
   ### Test
   
   Added `ebpps merge heavier sketch by const reference with an application 
allocator` to `ebpps_allocation_test.cpp`. It uses an allocator declared 
outside the `datasketches` namespace. Without the fix it doesn't compile; with 
it, all EBPPS tests pass (14 test cases).
   
   We found this in the [DuckDB DataSketches 
extension](https://github.com/Query-farm/datasketches), 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](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to