Repository navigation
Add pf17 uninitialized_move polyfill - #209
Closed
thirtytwobits wants to merge 2 commits into
Closed
thirtytwobits wants to merge 2 commits into
thirtytwobits wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation satisfies the documented API, rollback guarantees, facade conventions, and test requirements.
Review effort: Balanced
Findings: None
What changed in this PR
Adds the C++14-compatible uninitialized_move polyfill required for future exception-safe VLA construction.
Changes:
- Implements move construction with precise rollback on failure.
- Adds C++14/C++17 facade selection.
- Adds comprehensive algorithm and failure-path tests.
| File | Description |
|---|---|
include/cetl/pf17/memory.hpp |
Implements the polyfill and reusable rollback helper. |
include/cetl/pf17/cetlpf.hpp |
Exposes the polyfill or standard implementation. |
cetlvast/suites/unittest/test_pf17_memory.cpp |
Tests semantics, iterators, lifetimes, and failures. |
cetlvast/suites/unittest/CMakeLists.txt |
Registers the new test suite. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
CETL's C++14 polyfills lack the sequential
std::uninitialized_movealgorithm needed for the construction/rollback work in #37. Addcetl::pf17::uninitialized_moveincetl/pf17/memory.hpp, with standard move semantics, exact cleanup of successfully constructed destination objects on failure, and caller-owned storage.Follow the existing pf17 header, namespace, Doxygen, exception-guard, and facade conventions.
cetl::uninitialized_moveselects the polyfill in C++14 and the standard implementation in C++17 and newer. An internal construction/rollback helper accepts construction and destruction callbacks for subsequent allocator-aware VLA integration. It records each successful construction before advancing the input iterator, so an iterator exception also destroys the most recently constructed object.This branch is based directly on
main, independently of #207 and #208. VLA integration remains in #37.Closes #206.
Validation:
git diff --checkpass locally.