Re: [Boost-bugs] [Boost C++ Libraries] #9497: mpq_rational asserts when used in variant

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9497: mpq_rational asserts when used in variant
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-12-25 12:03:20


#9497: mpq_rational asserts when used in variant
-------------------------------------------+----------------------------
  Reporter: András Kucsma <r0maikx02b@…> | Owner: johnmaddock
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: multiprecision
   Version: Boost 1.55.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------------------+----------------------------
Changes (by apolukhin):

 * cc: antoshkka@… (added)
 * owner: apolukhin => johnmaddock
 * status: assigned => new
 * component: variant => multiprecision

Comment:

 It's not a bug, boost::variant tries to satisfy the newer-empty guarantee:
 * `boost::multiprecision::mpq_rational` has no noexcept default
 constructor because default constructor of `gmp_rational` is not marked
 with noexcept
 * `Foo` has no noexcept default constructor
 * because of previous two points variant can not use
 `boost::multiprecision::mpq_rational` or `Foo` as fallback types
 * copy constructor of `Foo` is not noexcept, there is no fallback type in
 variant, so it attempts '''to copy/move content of variant to backup
 storage''' before doing an assignment of `Foo`.
 * ...

 Looks like `gmp_rational` calls only pure C methods. Can the default
 constructor of `gmp_rational` be marked with noexcept?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9497#comment:7>
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:15 UTC