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

Generic comparison operators #95

Open
apolukhin opened this issue Sep 20, 2021 · 0 comments
Open

Generic comparison operators #95

apolukhin opened this issue Sep 20, 2021 · 0 comments

Comments

@apolukhin
Copy link
Member

It could be useful to have comparison operators with types that are held in variant. For example:

variant<int, string> v1(1), v2("2");
if (v1 < 1 || v2 > "hello") {
    // ...
}

if (v1 < 1.0) { // compilation error
    // ...
}

Issue was imported from Trac 10845

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