Repository navigation
[FixedList] Return insertion position for empty ranges - #227
Merged
alexkaratarakis merged 1 commit intoSep 22, 2026
Merged
Conversation
alexkaratarakis
force-pushed
the
codex/fix-fixed-list-empty-insert
branch
from
September 22, 2026 02:56
b1e166e to
e858ad2
Compare
Collaborator
|
Thank you for the fix! |
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.
Summary
Inserting an empty range before a non-end position in
FixedListreturnsend()instead of the supplied position. This differs fromstd::listand can move a caller's insertion cursor to the end even though no elements were inserted. The sequence-container requirements specify thatinsert(pos, first, last)returnsposwhenfirst == last.Both iterator-category paths now return the original insertion position when no node was inserted. Nonempty insertion under the default checking policy and capacity checks are unchanged. The initializer-list overload dispatches into the same forward-iterator path.
The regression covers begin, middle, and end positions for empty forward ranges, input-iterator ranges, and initializer lists, checking that contents and size remain unchanged. The forward-range and initializer-list cases are checked during constant evaluation; the input-iterator case is checked at runtime.
Testing
Validated on Ubuntu 24.04.3 with GCC 13.3, CMake 4.4.3, Ninja 1.11.1, C++20, and a Debug build using the repository's unmodified top-level CMake project. Dependencies were supplied as isolated CMake CONFIG packages using magic_enum v0.9.7, benchmark v1.9.5, and GoogleTest v1.15.2.
-Werrorand-fno-exceptionssettings.fixed_list_test93,fixed_deque_test81, andfixed_doubly_linked_list_test5.Prior direct compiler runs (GCC 13.3, GoogleTest v1.15.2, with
-Wno-sign-compare) also established:main(d0df5f67e102ba42025ef0ecf761d19a4510a543), the final regression fails to compile at both newstatic_asserts. An earlier runtime form also demonstrated the input-iterator begin/middle failures.The native CMake validation used an isolated dependency prefix rather than the repository's CI vcpkg toolchain and covered the three related targets, not the full repository or CI compiler/platform matrix.