chore: migrate SFINAE to C++20 concepts for partitioner, extractor#7637
Conversation
Replace std::enable_if with trailing requires clauses on ownership-mode constructors and methods in partitioner and extractor templates. - include/partitioner/multi_level_partition.hpp: 2 constructors - include/partitioner/cell_storage.hpp: 2 constructors + GetCell - include/extractor/node_data_container.hpp: Renumber method
There was a problem hiding this comment.
Pull request overview
Refactors ownership-mode gated overloads in partitioner and extractor templates by replacing std::enable_if-based SFINAE with C++20 trailing requires clauses. This aligns these modules with the concepts-based pattern already used elsewhere in the codebase and improves constraint readability/diagnostics without intended runtime behavior changes.
Changes:
- Replace ownership-gated constructors in
MultiLevelPartitionImplwith trailingrequiresconstraints. - Replace ownership-gated constructors and
GetCell()inCellStorageImplwith trailingrequiresconstraints. - Constrain
EdgeBasedNodeDataContainerImpl::Renumber()with a trailingrequiresclause for container ownership only.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| include/partitioner/multi_level_partition.hpp | Converts container/view constructor gating from SFINAE to trailing requires constraints. |
| include/partitioner/cell_storage.hpp | Converts container/view constructors and container-only GetCell() from SFINAE to trailing requires constraints. |
| include/extractor/node_data_container.hpp | Converts container-only Renumber() gating from SFINAE to trailing requires constraint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7637 +/- ##
==========================================
+ Coverage 90.80% 94.22% +3.41%
==========================================
Files 484 484
Lines 37789 37789
==========================================
+ Hits 34316 35606 +1290
+ Misses 3473 2183 -1290 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Issue
Closes #7535
Replaces
std::enable_ifownership-mode guards with C++20 trailingrequiresclauses in partitioner and extractor templates. Follows the same pattern already established inpacked_vector.hppandstatic_rtree.hpp.🤖 AI disclosure: Claude DeepSeek V4 Pro
Tasklist
Requirements / Relations
Part of #7530 (SFINAE → Concepts umbrella)
Related: #7632, #7631
Changes
include/partitioner/multi_level_partition.hpp: 2 ownership-gated constructors → trailingrequiresinclude/partitioner/cell_storage.hpp: 2 constructors +GetCell()→ trailingrequiresinclude/extractor/node_data_container.hpp:Renumber()→ trailingrequiresBuild verified: all 77 targets compile cleanly.