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

variant comparators #61

Closed
matpen opened this issue May 27, 2017 · 2 comments · Fixed by #78
Closed

variant comparators #61

matpen opened this issue May 27, 2017 · 2 comments · Fixed by #78

Comments

@matpen
Copy link

matpen commented May 27, 2017

I have two enhancement suggestions regarding the variant comparators:

  1. variant::operator>() seems to be missing; while it is perfectly possible to compare the other way around, it would be convenient to have it at one's disposal (along with "<=" and ">=").

  2. I have read in the docs that some types might need the manual registration of the comparators... it would be nice to have the opportunity to check if that happened, so that the program can notice that the result of the comparison is actually invalid: for example by introducing "rttr::type::has_less_than_comparator()" and analogous functions.

acki-m added a commit to acki-m/rttr that referenced this issue Aug 6, 2017
@acki-m
Copy link
Contributor

acki-m commented Aug 6, 2017

I implemented 1.

@matpen
Can you make a new issue for the 2nd task?

By the way, even if there is no comparison operator available for a given type, it might be, when the type is converted. The other things are template types like std::vector<T> they have operator< declared, but it might not work, when the underlying type T has no comparison operator implemented.

@matpen
Copy link
Author

matpen commented Aug 21, 2017

Thank you very much for working on this! I added #80 as you requested.
Regarding your observations: they are correct and should definitely be added to the documentation, I think.

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 a pull request may close this issue.

2 participants