Boost C++ Libraries: Ticket #8988: Boost.variant can not work with const rvalues https://svn.boost.org/trac10/ticket/8988 <p> Thanks to gast128! he found the following bug and reported it in mailing lists: </p> <p> I get a compilation error with Boost.Variant (which compiles fine on previous releases) with vstudio 2010 when a function returns a const Boost.Variant, e.g.: </p> <pre class="wiki">typedef boost::variant&lt;int, double&gt; Variant; const Variant GetVar() { return Variant(); } void TestVariantDnc() { const Variant var = GetVar(); } </pre><p> This gives error C2666 ('boost::variant&lt;T0_,T1&gt;::convert_construct' : 3 overloads have similar conversions'). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8988 Trac 1.4.3 Antony Polukhin Fri, 09 Aug 2013 07:35:26 GMT owner, status changed; cc set https://svn.boost.org/trac10/ticket/8988#comment:1 https://svn.boost.org/trac10/ticket/8988#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">antoshkka@…</span> added </li> <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 Mon, 12 Aug 2013 12:00:14 GMT <link>https://svn.boost.org/trac10/ticket/8988#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8988#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85315" title="Fix issue with const rvalue references in Boost.Variant (refs #8988)">[85315]</a>) Fix issue with const rvalue references in Boost.Variant (refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8988" title="#8988: Bugs: Boost.variant can not work with const rvalues (closed: fixed)">#8988</a>) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Tue, 20 Aug 2013 09:03:30 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8988#comment:3 https://svn.boost.org/trac10/ticket/8988#comment:3 <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> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85408" title="Merge from trunk: * Fix issue with const rvalue references in ...">[85408]</a>) Merge from trunk: </p> <ul><li>Fix issue with const rvalue references in Boost.Variant (fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8988" title="#8988: Bugs: Boost.variant can not work with const rvalues (closed: fixed)">#8988</a>) </li><li>Get rid of Boost.Variant hand written non-usable move emulation and use Boost.Move instead(refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7601" title="#7601: Bugs: Does not use Boost.Move (closed: obsolete)">#7601</a>). This does not mean that Boost.Variant supports move emulation now, but removes duplicate/non-working code and makes sure that Boost.Variant is able to work with boost::move </li></ul> Ticket