Skip to content

fix: fix C++ code for standard compliance (C++17) - #42

Open
f-dy wants to merge 1 commit into
danini:masterfrom
f-dy:fix/cpp17-compliance
Open

fix: fix C++ code for standard compliance (C++17)#42
f-dy wants to merge 1 commit into
danini:masterfrom
f-dy:fix/cpp17-compliance

Conversation

@f-dy

@f-dy f-dy commented May 29, 2026

Copy link
Copy Markdown

Description

Fix C++17 standard compliance issue that prevents compilation with any conforming C++17 compiler (including Apple clang 21 on macOS):

magsac.hconstexpr size_t sample_size = estimator_.sampleSize() calls sampleSize() on an instance, which is not a constant expression. Fix: call it as a static method on the type (ModelEstimator::sampleSize()), which is static constexpr and produces a valid constant expression.

The bundle.cpp fix (assigning to member function R()) was already merged upstream in graph-cut-ransac. This PR updates the submodule pointer to include that fix.

Changes

  • src/pymagsac/include/magsac.hestimator_.sampleSize()ModelEstimator::sampleSize() (4 occurrences)
  • graph-cut-ransac submodule → updated to latest (includes bundle.cpp fix)

Testing

  • pip install . succeeds on macOS with Apple clang 21.0.0 (with -DUSE_OPENMP=OFF)
  • All existing tests pass

@f-dy
f-dy force-pushed the fix/cpp17-compliance branch from a38fc59 to 8cfd8c3 Compare May 29, 2026 10:13
- 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
f-dy force-pushed the fix/cpp17-compliance branch from 8cfd8c3 to 1c37395 Compare May 29, 2026 11:59
@f-dy
f-dy marked this pull request as ready for review May 29, 2026 12:00
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.

1 participant