Re: [Boost-bugs] [Boost C++ Libraries] #10399: Breaking change in Boost.Optional

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10399: Breaking change in Boost.Optional
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-01-20 09:52:10


#10399: Breaking change in Boost.Optional
-------------------------------+---------------------------------
  Reporter: mikhailberis | Owner: fcacciola
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: optional
   Version: Boost 1.54.0 | Severity: Regression
Resolution: | Keywords: optional regression
-------------------------------+---------------------------------

Comment (by akrzemi1):

 This is caused by a compiler bug in MSVC, see
 [https://connect.microsoft.com/VisualStudio/feedback/details/967397
 /incorrect-conversion-handling-in-c]. This was added when implementing
 move semantics and cannot be taken out without taking move semantics out.
 I could forcibly counteract Microsoft double conversions, but do not feel
 that this is a good idea. The problem is also observable in Boost.Variant,
 and no-one seams to be questioning it implementing move semantics:


 {{{
 #include <boost/variant.hpp>

 struct Wrapper
 {
   operator int () { return 9; }
   operator boost::variant<int, long> () { return 7; }
 };

 int main()
 {
   boost::variant<int, long> v = Wrapper();
   assert(boost::get<int>(v) == 7);
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10399#comment:2>
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:17 UTC