Skip to content

Upgrade OR-Tools to C++20 across all platforms#4960

Merged
gchatelet merged 5 commits intomainfrom
bump_to_cxx20
Dec 23, 2025
Merged

Upgrade OR-Tools to C++20 across all platforms#4960
gchatelet merged 5 commits intomainfrom
bump_to_cxx20

Conversation

@gchatelet
Copy link
Collaborator

@gchatelet gchatelet commented Dec 19, 2025

  • source: cleanup code (80%)
  • bazel: migrate to c++20
    • bazel: update bazel/README.md
  • cmake: migrate UNIX platforms to C++20

@Mizux
Copy link
Collaborator

Mizux commented Dec 22, 2025

missing README.md

or-tools/bazel/README.md

Lines 77 to 81 in af5487d

* on UNIX:
```sh
bazel build -c opt --cxxopt=-std=c++17 ...
```

and

or-tools/bazel/README.md

Lines 93 to 97 in af5487d

* on UNIX:
```sh
bazel test -c opt --cxxopt=-std=c++17 ...
```

note: Since now, we have a bazelrc, this is not needed anymore ? (and both windows and unix can use the same cmd without any option)

@Mizux
Copy link
Collaborator

Mizux commented Dec 22, 2025

also spotted:

// For integers using two's complement (all compilers in practice up to
// c++17, and all compilers in theory starting from c++20), we can use a

#include <filesystem> // NOLINT(build/c++17)

bazel run -c opt --cxxopt=-std=c++17 ortools/python:ortools_notebook

bazel run -c opt --cxxopt=-std=c++17 ortools/python:ortools_notebook -- --no-browser

// NOLINTNEXTLINE(build/c++17)

@gchatelet
Copy link
Collaborator Author

I think it's all fixed, let me know if you see anything else.

Copy link
Collaborator

@Mizux Mizux left a comment

Choose a reason for hiding this comment

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

LGTM

@gchatelet gchatelet merged commit 9edab82 into main Dec 23, 2025
20 of 22 checks passed
@gchatelet gchatelet deleted the bump_to_cxx20 branch December 23, 2025 09:06
@Mizux Mizux added this to the v10.0 Beta milestone Feb 16, 2026
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.

2 participants