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

Comparison traits should check for boolean return type #1652

Open
deadlocklogic opened this issue Nov 27, 2024 · 0 comments
Open

Comparison traits should check for boolean return type #1652

deadlocklogic opened this issue Nov 27, 2024 · 0 comments

Comments

@deadlocklogic
Copy link
Contributor

Currently the comparison traits are using:
supports_op_less_test -> void_t<decltype(std::declval<T&>() < std::declval<U&>())>
supports_op_equal_test -> void_t<decltype(std::declval<T&>() == std::declval<U&>())>
supports_op_less_equal_test -> void_t<decltype(std::declval<T&>() <= std::declval<U&>())>
instead of:
std::enable_if_t<std::is_same_v<decltype(std::declval<T&>() < std::declval<U&>()), bool>>
std::enable_if_t<std::is_same_v<decltype(std::declval<T&>() == std::declval<U&>()), bool>>
std::enable_if_t<std::is_same_v<decltype(std::declval<T&>() <= std::declval<U&>()), bool>>
Because some libraries have their weird own comparison return type, especially with optional types.

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