[Boost-bugs] [Boost C++ Libraries] #8555: Variant, Implicit Conversions and C++11

Subject: [Boost-bugs] [Boost C++ Libraries] #8555: Variant, Implicit Conversions and C++11
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-05-08 18:03:28


#8555: Variant, Implicit Conversions and C++11
--------------------------------------------------+-------------------------
 Reporter: Bryan Catanzaro <bcatanzaro@…> | Owner: ebf
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: variant
  Version: Boost 1.53.0 | Severity: Regression
 Keywords: |
--------------------------------------------------+-------------------------
 With c++11 enabled on g++, the following code compiles on Boost 1.48.0,
 but not on Boost 1.53.0. It appears the machinery choosing construction
 method thinks I'm trying to convert from a convertible to an int, rather
 than from a convertible to a my_variant. If I disable c++11, this code
 compiles with Boost 1.53.0.

 Here's the error:
 /home/bcatanzaro/boost_1_53_0/boost/variant/variant.hpp:1574:9: error: no
 matching function for call to
 â€˜boost::variant<int>::initializer::initialize(void*,
 std::remove_reference<convertible&>::type)’

 And here's a reproducer:

 #include <boost/variant.hpp>

 typedef boost::variant<int> my_variant;

 struct convertible
 {
   operator my_variant() const
   {
         return my_variant();
   }
 };

 int main()
 {
   my_variant y = convertible();
 }

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8555>
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:13 UTC