<div dir="ltr">2013/8/4 gast128 <span dir="ltr"><<a href="mailto:gast128@hotmail.com" target="_blank">gast128@hotmail.com</a>></span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Dear all,<br> <br> I get a compilation error with Boost.Variant (which compiles fine on<br> previous releases) with vstudio 2010 when a function returns a const<br> Boost.Variant, e.g.:<br> <br> typedef boost::variant<int, double> Variant;<br> <br> const Variant GetVar()<br> {<br> � return Variant();<br> }<br> <br> <br> void TestVariantDnc()<br> {<br> � �const Variant var = GetVar();<br> }<br> <br> This gives error C2666 ('boost::variant<T0_,T1>::convert_construct' : 3<br> overloads have similar conversions').<br></blockquote><div><br></div><div>I think this is an interesting example. For a copyable and movable type T:</div><div>const T f();</div><div>int main()</div><div>{</div><div>� T t = f(); //???</div> <div><br></div><div>Should this:</div><div>a) not compile? (like in the variant example above)</div><div>b) use the copy constructor instead of moving?</div><div>c) move anyway?</div><div><br></div><div>Looks like this is caused by move-emulation for variant, isn't it?</div> <div><br></div><div>Regards,�</div><div>Kris</div></div></div></div>