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

[conv.rank] p1.10 Improve the definition of comparing ranks #5159

Open
xmh0511 opened this issue Dec 20, 2021 · 0 comments
Open

[conv.rank] p1.10 Improve the definition of comparing ranks #5159

xmh0511 opened this issue Dec 20, 2021 · 0 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Dec 20, 2021

[conv.rank] p1.10 says

For all integer types T1, T2, and T3, if T1 has greater rank than T2 and T2 has greater rank than T3, then T1 has greater rank than T3.

This definition only gives the approach of comparing indirect "greater" relationships. It also hints that we cannot assume that the mathematic comparison relationships can apply to these concepts. In other words, we didn't give a complete definition of how to compare the "transitive" comparable relationships. For instance

[conv.rank] p1.3 says that the rank of long int is greater than the rank of int

and

[conv.rank] p1.4 says that the rank of int equals the rank of unsigned int.

So, how to compare the rank of long int and the rank of unsigned int? They're not the concept in the mathematical domain. Hence, I think we should augment [conv.rank] p1.10 to assign them concrete definitions. The addition part may be that

If T1 has a greater rank than T2 and T2 equals T3, then T1 has a greater rank than T3. Conversely, if T1 has less rank than T2 and T2 equals T3, then T1 has less rank than T3.

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

No branches or pull requests

1 participant