boostorg/variant

Generic comparison operators

Opened this issue · 0 comments

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