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

Use the implementation-defined strict total order for pointer comparisons with not_null #1106

Merged

Conversation

dmitrykobets-msft
Copy link
Member

Using <,<=,>,>= to compare unrelated pointers gives an unspecified result according to standard.
This PR replaces the usage of these operators in gsl::not_null with the STL counterparts, which would leverage any implementation-defined strict total ordering for pointers.

Resolves #880

@dmitrykobets-msft dmitrykobets-msft marked this pull request as draft May 4, 2023 19:16
@dmitrykobets-msft dmitrykobets-msft marked this pull request as ready for review May 4, 2023 20:25
@dmitrykobets-msft dmitrykobets-msft merged commit 5dc7fae into microsoft:main May 9, 2023
66 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.

use std::less instead of < for comparison
1 participant