Opened 11 years ago

Closed 6 years ago

#5871 closed Bugs (fixed)

variant constructible/assignable from anything

Reported by: kaballo86@… Owned by: Antony Polukhin
Milestone: Boost 1.62.0 Component: variant
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc: raad@…

Description

Boost variant has a constructor and an assignment operator that would take just anything. If it cannot be converted to any of its bounded types, it will result in an error within variant's internals. This, mixed with conversion operators, interferes with overload resolution (code that reproduces the issue attached). SFINAE'ing out the non-candidate constructors (and assignments) would fix this.

Attachments (1)

main.cpp (340 bytes ) - added by kaballo86@… 11 years ago.

Download all attachments as: .zip

Change History (6)

by kaballo86@…, 11 years ago

Attachment: main.cpp added

comment:1 by raad@…, 7 years ago

Cc: raad@… added

comment:2 by raad@…, 7 years ago

This problem also makes boost::variant unusable in C++17's std::tuple as implemented in MSVC 14 Update 2, affecting boost::signals2 (ticket #12123). A solution has been proposed in ticket #11602.

comment:3 by Antony Polukhin, 6 years ago

Milestone: To Be DeterminedBoost 1.62.0
Owner: changed from ebf to Antony Polukhin
Status: newassigned

comment:4 by Antony Polukhin, 6 years ago

Fixed in b3650685 develop, will be merged to the master branch as soon as the regression tests will cycle.

comment:5 by Antony Polukhin, 6 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.