Re: [Boost-bugs] [Boost C++ Libraries] #12299: User-defined conversion operator from a wrapper class to a boost/multiprecision floating-point type does not compile.

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12299: User-defined conversion operator from a wrapper class to a boost/multiprecision floating-point type does not compile.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-06-24 19:58:57


#12299: User-defined conversion operator from a wrapper class to a
boost/multiprecision floating-point type does not compile.
-------------------------------------------+----------------------------
  Reporter: Ulrich Mutze <ulrichmutze@…> | Owner: johnmaddock
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: multiprecision
   Version: Boost 1.61.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------------------+----------------------------

Comment (by anonymous):

 I'm having a hard time too understanding why my compiler does not respect
 what Stroustrup's 'The C++ programming language', 4th edition, says on the
 first half of p. 544. For exemplification he defines a class Tiny of small
 integers and endows it with the arithmetic facilities of type int by
 providing a member function Tiny::operator int()const which is asserted to
 effect implicit conversion (if a direct function call is not defined). Not
 being really familiar with the standard I simply googled 'conversion
 operator C++ standard' and got a page that seemed to me expressing the
 same in a more formal language.
 On the other hand, all my attempts to define 'R' as a simple self-made
 class, for which the intended
 type conversion would work, failed. So, the problem seems to be one of
 modern C++ implementations more than one of boost/multiprecision. However,
 it should be noted that (at least on my system) R1 works as intended for R
 defined as mpreal.

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