Boost C++ Libraries: Ticket #8555: Variant, Implicit Conversions and C++11 https://svn.boost.org/trac10/ticket/8555 <p> 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. </p> <p> 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&lt;int&gt;::initializer::initialize(void*, std::remove_reference&lt;convertible&amp;&gt;::type)’ </p> <p> And here's a reproducer: </p> <p> #include &lt;boost/variant.hpp&gt; </p> <p> typedef boost::variant&lt;int&gt; my_variant; </p> <p> struct convertible { </p> <blockquote> <p> operator my_variant() const { </p> <blockquote> <p> return my_variant(); </p> </blockquote> <p> } </p> </blockquote> <p> }; </p> <p> int main() { </p> <blockquote> <p> my_variant y = convertible(); </p> </blockquote> <p> } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8555 Trac 1.4.3 Antony Polukhin Fri, 10 May 2013 19:32:14 GMT owner, status changed https://svn.boost.org/trac10/ticket/8555#comment:1 https://svn.boost.org/trac10/ticket/8555#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">ebf</span> to <span class="trac-author">Antony Polukhin</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Antony Polukhin Tue, 20 Aug 2013 09:43:52 GMT <link>https://svn.boost.org/trac10/ticket/8555#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8555#comment:2</guid> <description> <p> This issue was discussed at mailing lists <a class="ext-link" href="http://boost.2283326.n4.nabble.com/boost-variant-amp-c-11-td4646944.html"><span class="icon">​</span>here</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Fri, 27 May 2016 22:45:03 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/8555#comment:3 https://svn.boost.org/trac10/ticket/8555#comment:3 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.62.0</span> </li> </ul> <p> Fixed in <a class="ext-link" href="https://github.com/boostorg/variant/commit/b3650685f941a0c35cadfd878a185f274e132788"><span class="icon">​</span>b3650685 develop</a>, will be merged to the master branch as soon as the regression tests will cycle. </p> Ticket Antony Polukhin Fri, 27 May 2016 22:49:51 GMT <link>https://svn.boost.org/trac10/ticket/8555#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8555#comment:4</guid> <description> <p> Test added in <a class="ext-link" href="https://github.com/boostorg/variant/commit/85d7a5c72d5291803c22a744a00b0829bbf417d3"><span class="icon">​</span>85d7a5c7</a>, typo fixed in <a class="ext-link" href="https://github.com/boostorg/variant/commit/9f234aefa410ad4fd686703dcb6439f6ea0fa0dc"><span class="icon">​</span>9f234aef</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Sat, 29 Oct 2016 18:08:49 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8555#comment:5 https://svn.boost.org/trac10/ticket/8555#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket