fix: fix C++ code for standard compliance (C++17) - #42
Open
f-dy wants to merge 1 commit into
Open
Conversation
f-dy
force-pushed
the
fix/cpp17-compliance
branch
from
May 29, 2026 10:13
a38fc59 to
8cfd8c3
Compare
- magsac.h: Call sampleSize() as static method on the type (ModelEstimator::sampleSize()) instead of on an instance, so the result is a valid constexpr. - Update graph-cut-ransac submodule to latest (includes bundle.cpp fix for CameraPose::R() assignment).
f-dy
force-pushed
the
fix/cpp17-compliance
branch
from
May 29, 2026 11:59
8cfd8c3 to
1c37395
Compare
f-dy
marked this pull request as ready for review
May 29, 2026 12:00
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.
Description
Fix C++17 standard compliance issue that prevents compilation with any conforming C++17 compiler (including Apple clang 21 on macOS):
magsac.h —
constexpr size_t sample_size = estimator_.sampleSize()callssampleSize()on an instance, which is not a constant expression. Fix: call it as a static method on the type (ModelEstimator::sampleSize()), which isstatic constexprand produces a valid constant expression.The
bundle.cppfix (assigning to member functionR()) was already merged upstream in graph-cut-ransac. This PR updates the submodule pointer to include that fix.Changes
src/pymagsac/include/magsac.h—estimator_.sampleSize()→ModelEstimator::sampleSize()(4 occurrences)graph-cut-ransacsubmodule → updated to latest (includes bundle.cpp fix)Testing
pip install .succeeds on macOS with Apple clang 21.0.0 (with-DUSE_OPENMP=OFF)