[CK] Refactor container array and function sequence_reverse_inclusive_scan #3612
+240
−20
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.
Refactor cd
sequence_reverse_inclusive_scanfrom recursive template to constexpr for-loop.This pull request improves the utility array functionality and its integration with sequence utilities, as well as adds comprehensive unit tests for the
Arrayclass. The main changes include refactoring the implementation of reverse inclusive scan for sequences, updating header dependencies, optimizing theArrayassignment operator, and introducing a full test suite forArray.Array and Sequence Utility Improvements:
sequence_reverse_inclusive_scaninsequence.hppto use a more efficient, array-based approach, encapsulated in a newimplnamespace. This change simplifies the logic and should improve compile-time performance.array.hppandsequence.hppto remove unused includes and ensure correct dependency order, notably includingarray.hppinsequence.hppto support the new scan implementation. [1] [2]Arraystruct by replacing thestatic_forloop with a standard for-loop and adding a pragma for potential unrolling, improving both readability and performance.Testing Enhancements:
unit_array.cppwith comprehensive tests covering construction, element access, assignment, iterators, themake_arrayhelper, and different data types for theArrayclass.CMakeLists.txtto build and link the newunit_arraytest executable.Tracking issue: #3575