Skip to content

chore: raise npsim baseline to C++20 and modernize C++17-era target/code usage#51

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/upgrade-to-cpp20-standard
Open

chore: raise npsim baseline to C++20 and modernize C++17-era target/code usage#51
Copilot wants to merge 2 commits into
mainfrom
copilot/upgrade-to-cpp20-standard

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 17, 2026

This updates the project to use C++20 as the minimum/default language level and removes remaining C++17 target requirements. It also applies a focused code-path simplification enabled by C++20 container APIs.

  • Build standard policy

    • Set project default C++ standard to 20 in top-level CMake.
    • Tightened accepted override standards from 17|20|23 to 20|23.
  • Target-level CMake requirements

    • Replaced cxx_std_17 with cxx_std_20 in:
      • src/geocad/CMakeLists.txt
      • src/tools/CMakeLists.txt
    • Keeps per-target declarations aligned with project-wide baseline.
  • C++20 simplification in code

    • Simplified map lookup in TOCCToStep::GetLabelOfVolume using contains() + at() instead of find()/end() + indexed access.
    • This makes intent explicit and avoids implicit insertion semantics from operator[].
if (fTree.contains(v))
   return fTree.at(v);
return TDF_Label{};

@wdconinc wdconinc marked this pull request as ready for review May 17, 2026 17:21
Copilot AI review requested due to automatic review settings May 17, 2026 17:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates npsim’s build configuration and a small GeoCad code path to assume a C++20 baseline, removing remaining C++17 requirements and using C++20 container APIs where helpful.

Changes:

  • Set project-wide default C++ standard to 20 and restrict allowed overrides to 20 or 23.
  • Update per-target CMake cxx_std_* requirements from 17 → 20 in tools and GeoCad.
  • Simplify TOCCToStep::GetLabelOfVolume using std::map::contains() + at().

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
CMakeLists.txt Raises project default C++ standard to 20 and tightens accepted standard overrides.
src/tools/CMakeLists.txt Updates tool executables’ target compile features to require C++20.
src/geocad/CMakeLists.txt Updates GeoCad library target compile features to require C++20.
src/geocad/src/TOCCToStep.cxx Uses C++20 contains()/at() for map lookup and avoids operator[].

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CMakeLists.txt Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@wdconinc wdconinc changed the title Raise npsim baseline to C++20 and modernize C++17-era target/code usage chore: raise npsim baseline to C++20 and modernize C++17-era target/code usage May 17, 2026
@wdconinc wdconinc requested a review from a team May 17, 2026 17:29
@wdconinc wdconinc enabled auto-merge (squash) May 17, 2026 18:12
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.

3 participants