Boost logo

Boost Users :

Subject: [Boost-users] rational - 1.64 version shear?
From: Nicholas Devenish (ndevenish_at_[hidden])
Date: 2017-07-13 22:17:46


With boost/rational.hpp, the code:

    boost::rational<int> a{1};
    long b{1};
    auto c{a * b};

Works fine up to 1.63.0, but fails to compile in 1.64+ on the
multiplication with "error: invalid operands to binary expression".
This seems to be due to some restructuring that changed the way
multiplications are declared, which (as far as I can tell), meant the
operation declaration became conditional on number of representable
digits.

This breaking change isn't listed on the release notes or the
::rational documentation, so I'm wondering if it was accidental and
therefore a bug (whose behaviour might change), or a deliberate change
to prevent downcasting and just undocumented?

Nick

(I've come onto a project stuck on 1.56 and trying to update it)


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net