Modify

Ticket #8988 (closed Bugs: fixed)

Opened 8 months ago

Last modified 8 months ago

Boost.variant can not work with const rvalues

Reported by: apolukhin Owned by: apolukhin
Milestone: Boost 1.55.0 Component: variant
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc: antoshkka@…

Description

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').

Attachments

Change History

comment:1 Changed 8 months ago by apolukhin

  • Cc antoshkka@… added
  • Owner changed from ebf to apolukhin
  • Status changed from new to assigned

comment:2 Changed 8 months ago by apolukhin

(In [85315]) Fix issue with const rvalue references in Boost.Variant (refs #8988)

comment:3 Changed 8 months ago by apolukhin

  • Status changed from assigned to closed
  • Resolution set to fixed

(In [85408]) Merge from trunk:

  • Fix issue with const rvalue references in Boost.Variant (fixes #8988)
  • Get rid of Boost.Variant hand written non-usable move emulation and use Boost.Move instead(refs #7601). 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
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.