Skip to content
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

fix: check if std::pair has less than #163

Merged
merged 3 commits into from
Jun 16, 2024

Conversation

PraneethJain
Copy link
Contributor

@PraneethJain PraneethJain commented Jun 13, 2024

https://github.com/JuliaInterop/CxxWrap.jl#main

std::pair directly has a operator< before c++20, and since it is not treated as a container, std::set was being applied to incompatible types. The tests weren't failing here because since c++20 <=> is used to synthesize operator< (https://en.cppreference.com/w/cpp/utility/pair/operator_cmp)

Because of this, inconsistent behavior was being observed
https://pastebin.ai/0stwtqgvry
The above program outputs different values for c++17 and c++20

This PR fixes this issue by explicitly checking if the pair types are comparable.

@PraneethJain
Copy link
Contributor Author

@barche this should fix JuliaIPU/IPUToolkit.jl#66

barche added 2 commits June 16, 2024 10:40
Also:
* adds the JLCXX_FORCE_RANGES_OFF compile flag
* suppresses warnings when compiling without ranges
* bumps version to v0.13.2
@barche barche merged commit 65fb7a3 into JuliaInterop:main Jun 16, 2024
6 of 11 checks passed
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