[Boost-bugs] [Boost C++ Libraries] #8988: Boost.variant can not work with const rvalues

Subject: [Boost-bugs] [Boost C++ Libraries] #8988: Boost.variant can not work with const rvalues
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-08-09 07:31:18


#8988: Boost.variant can not work with const rvalues
--------------------------+---------------------
 Reporter: apolukhin | Owner: ebf
     Type: Bugs | Status: new
Milestone: Boost 1.55.0 | Component: variant
  Version: Boost 1.54.0 | Severity: Problem
 Keywords: |
--------------------------+---------------------
 Thanks to gast128! he found the following bug and reported it in mailing
 lists:

 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.:
 {{{
 typedef boost::variant<int, double> Variant;

 const Variant GetVar()
 {
   return Variant();
 }


 void TestVariantDnc()
 {
    const Variant var = GetVar();
 }
 }}}
 This gives error C2666 ('boost::variant<T0_,T1>::convert_construct' : 3
 overloads have similar conversions').

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