Opened 6 years ago

#12802 new Bugs

optional<recursive_wrapper> is broken in 1.63

Reported by: pal666@… Owned by: Fernando Cacciola
Milestone: To Be Determined Component: optional
Version: Boost 1.63.0 Severity: Regression
Keywords: Cc:

Description

boost::optional<boost::recursive_wrapper<int> > o;
o = 1;

gcc says error: no match for 'operator=' (operand types are 'boost::optional<boost::recursive_wrapper<int> >' and 'int')

i found the reason for failure: is_convertible_to_T_or_factory checks is_constructinble<T, U&&>, which means <recursive_wrapper<U>, U&&>, while recursive wrapper specializes only <recursive_wrapper<T>,T> (no &&) as true and <recursive_wrapper<T>,U> (catches U=T&&) as false

i don't know who is wrong - recursive_wrapper or optional it can be fixed either by adding

template <class T> struct is_constructible < recursive_wrapper < T>, T &&> : boost::true_type{};

to recursive_wrapper or by changing boost::is_constructible<T, U&&> to boost::is_constructible<T, U> in is_convertible_to_T_or_factory

Change History (0)

Note: See TracTickets for help on using tickets.