Repository navigation
fix: avoid shared_ptr::unique for C++20 compatibility - #482
Merged
Merged
Conversation
Replace the deprecated and C++20-removed shared_ptr::unique() API with equivalent use_count() checks so paimon-cpp remains usable by consumers building with newer C++ standards.
Member
Author
|
Thanks @lxy-9602 for the quick review! CI failure is due to timeout. Could you please retrigger it or simply merge this? |
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.
Purpose
Linked issue: N/A
Replace
std::shared_ptr::unique()with the equivalentuse_count()checks in the real-time deduplication and key-offset index code.unique()is deprecated since C++17 and removed from libc++ in C++20. Although paimon-cpp itself currently builds as C++17, downstream projects can compile against its sources or headers in C++20 or newer. That currently fails because these two call sites use an API that is no longer available. The replacement has identical semantics and keeps the code compatible with C++17 and newer standards.Tests
_LIBCPP_ENABLE_CXX20_REMOVED_SHARED_PTR_UNIQUEcompatibility macro. Both compilations passed.API and Format
No public API, storage format, or protocol changes.
Documentation
No documentation changes are required; this fixes downstream C++20+ compatibility without changing user-facing behavior.
Generative AI tooling
Generated-by: OpenAI Codex 0.162.1