Repository navigation
Extend NonRelocatable vector API - #599
Conversation
6eb46d6 to
74bd619
Compare
|
Documentation preview for this pull request is available at: |
|
@fbaeuerle, @mihajlo-k, @Nikhil2206 can some of you review this PR? |
mihajlo-k
left a comment
There was a problem hiding this comment.
LGTM.
btw, out of the scope here, but looking at these changes I think we could add [[nodiscard]] on some other methods as well. Also zero the size and capacity on move assignment.
I added an issue: #601 |
There was a problem hiding this comment.
🟡 Changes recommended
Required test traceability metadata and repository naming, documentation, and copyright conventions must be addressed.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Extends NonRelocatableVector with standard capacity-management operations and corresponding tests.
Changes:
- Adds
pop_back(),clear(), andempty(). - Resets moved-from state and centralizes element destruction.
- Adds comprehensive API tests and a Bazel test target.
File summaries
| File | Description |
|---|---|
score/containers/non_relocatable_vector.h |
Implements the new APIs and destruction helper. |
score/containers/non_relocatable_vector_special_member_funcs_test.cpp |
Tests moved-from size and capacity. |
score/containers/non_relocatable_vector_capacity_test.cpp |
Tests empty, pop-back, and clear behavior. |
score/containers/BUILD |
Registers the new test target. |
Review details
Suppressed comments (4)
score/containers/non_relocatable_vector.h:148
- The new Doxygen tags use backslash syntax, while the C++ style guide requires
@-prefixed tags (docs/cpp-style-guide.md:54-56).
/// \brief Destroys every element, reducing size() to zero.
/// \note capacity() is unchanged and no memory is deallocated.
score/containers/non_relocatable_vector.h:149
clearis a newly introduced method, but repository C++ methods must use PascalCase (docs/cpp-style-guide.md:27-28). Rename it toClearand update its definition and callers.
void clear() noexcept;
score/containers/non_relocatable_vector.h:164
- The new Doxygen tag uses backslash syntax, while the C++ style guide requires the
@briefform (docs/cpp-style-guide.md:54-56).
/// \brief Checks whether the vector has no elements.
score/containers/non_relocatable_vector.h:197
- The new Doxygen tag uses backslash syntax, while the C++ style guide requires the
@briefform (docs/cpp-style-guide.md:54-56).
/// \brief Destroys every constructed element, leaving size_ and the underlying storage untouched.
- Files reviewed: 4/4 changed files
- Comments generated: 6
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| } | ||
| } | ||
|
|
||
| TYPED_TEST(NonRelocatableVectorTrivialFixture, MoveConstructingLeavesSourceWithZeroSizeAndCapacity) |
There was a problem hiding this comment.
Agree that this needs to be done. There also a PR already cleaning up the containers lib. #568
I will not do the move assignment in this PR since it has a bigger scope, impacting Dynamic Array contracts |
Added API: - pop_back - clear - empty
cd837b4 to
2af4ae7
Compare
Added API: