[Boost-bugs] [Boost C++ Libraries] #12802: optional<recursive_wrapper> is broken in 1.63

Subject: [Boost-bugs] [Boost C++ Libraries] #12802: optional<recursive_wrapper> is broken in 1.63
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-02-01 16:03:27


#12802: optional<recursive_wrapper> is broken in 1.63
------------------------------+------------------------
 Reporter: pal666@… | Owner: fcacciola
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: optional
  Version: Boost 1.63.0 | Severity: Regression
 Keywords: |
------------------------------+------------------------
 {{{
 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

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12802>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:21 UTC