Opened 8 years ago

Closed 13 months ago

#10845 closed Feature Requests (duplicate)

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 (1)

comment:1 by Antony Polukhin, 13 months ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.