-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idea: use constexpr for int version functions #3222
Comments
not trivial. constexpr int OrToolsMajorVersion() in the .h, defined in the .cc does not work. This means that the OR_TOOLS_VERSION must be used in the .h, which will not work as this will not be defined in users makefile including ortools/base/version.h |
I would like to use |
Thanks for the responses. If it's non-trivial, no worries. fwiw, it looks like PyTorch uses a separate script with a note about Bazel that populates version.h.in. EDIT(mizux): and the bazel wrapper around the python script: |
Interesting link: https://dev.to/davidb31/experimentations-on-bazel-version-txt-g1k |
What language and solver does this apply to? C++
Describe the problem you are trying to solve.
Hi, I'd like to check the OR-Tools version during compilation to make sure it's compatible with the C++ code that uses it.
Describe the solution you'd like
Use
constexpr
forint
version functionsso users can do
Describe alternatives you've considered
Another option would be to export the
OR_TOOLS_MAJOR
,OR_TOOLS_MINOR
, andOR_TOOLS_PATCH
constants.The text was updated successfully, but these errors were encountered: