Skip to content

chore: migrate SFINAE to C++20 concepts for partitioner, extractor#7637

Merged
DennisOSRM merged 1 commit into
masterfrom
refactor/partitioner-extractor-sfinae-to-concepts
Jun 28, 2026
Merged

chore: migrate SFINAE to C++20 concepts for partitioner, extractor#7637
DennisOSRM merged 1 commit into
masterfrom
refactor/partitioner-extractor-sfinae-to-concepts

Conversation

@DennisOSRM

Copy link
Copy Markdown
Collaborator

Issue

Closes #7535

Replaces std::enable_if ownership-mode guards with C++20 trailing requires clauses in partitioner and extractor templates. Follows the same pattern already established in packed_vector.hpp and static_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 → trailing requires
  • include/partitioner/cell_storage.hpp: 2 constructors + GetCell() → trailing requires
  • include/extractor/node_data_container.hpp: Renumber() → trailing requires

Build verified: all 77 targets compile cleanly.

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
Copilot AI review requested due to automatic review settings June 28, 2026 15:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 MultiLevelPartitionImpl with trailing requires constraints.
  • Replace ownership-gated constructors and GetCell() in CellStorageImpl with trailing requires constraints.
  • Constrain EdgeBasedNodeDataContainerImpl::Renumber() with a trailing requires clause 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.

@DennisOSRM DennisOSRM changed the title refactor(partitioner,extractor): migrate SFINAE to C++20 concepts chore(partitioner,extractor): migrate SFINAE to C++20 concepts Jun 28, 2026
@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.22%. Comparing base (58fb6e6) to head (e974abc).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DennisOSRM DennisOSRM changed the title chore(partitioner,extractor): migrate SFINAE to C++20 concepts chore: migrate SFINAE to C++20 concepts for partitioner, extractor Jun 28, 2026
@DennisOSRM DennisOSRM merged commit 568e016 into master Jun 28, 2026
26 of 28 checks passed
@DennisOSRM DennisOSRM deleted the refactor/partitioner-extractor-sfinae-to-concepts branch June 28, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SFINAE -> Concepts: Migrate partitioner and extractor templates

2 participants