Opened 6 years ago

Closed 16 months 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@…


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@… 6 years ago.

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by kaballo86@…

Attachment: main.cpp added

comment:1 Changed 23 months ago by raad@…

Cc: raad@… added

comment:2 Changed 23 months ago by raad@…

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 Changed 21 months ago by Antony Polukhin

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

comment:4 Changed 21 months ago by Antony Polukhin

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

comment:5 Changed 16 months ago by Antony Polukhin

Resolution: fixed
Status: assignedclosed

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Antony Polukhin.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.