Opened 4 years ago

#10845 new Feature Requests

Generic comparison operators

Reported by: Antony Polukhin Owned by: Antony Polukhin
Milestone: To Be Determined Component: variant
Version: Boost 1.57.0 Severity: Optimization
Keywords: Cc:

Description

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
    // ...
}

Change History (0)

Note: See TracTickets for help on using tickets.