Re: [Boost-bugs] [Boost C++ Libraries] #10270: square root of boost units scaled_unit fails to compile

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10270: square root of boost units scaled_unit fails to compile
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-20 12:14:54


#10270: square root of boost units scaled_unit fails to compile
-------------------------------+-----------------------------
  Reporter: sharifmarat@… | Owner: matthiasschabel
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: units
   Version: Boost 1.55.0 | Severity: Problem
Resolution: | Keywords: scale
-------------------------------+-----------------------------

Comment (by petamas@…):

 Hi all,
 here's a fix for this problem:
 {{{
 namespace boost
 {
   namespace mpl
   {
     template<>
     struct
 divides_impl<boost::units::scale_dim_tag,boost::units::detail::static_rational_tag>
     {
       template<class T0, class T1>
       struct apply
       {
         typedef boost::units::scale_list_dim<
           boost::units::scale<
             (T0::base),
             typename mpl::divides<typename T0::exponent, T1>::type
>
> type;
       };
     };
   }
 }
 }}}

 The main problem is that boost::mpl::divides does not work for a
 scale_list_dim and a static_rational. Power works because
 boost::mpl::times is implemented in boost/units/detail/unscale.hpp. (In
 fact, my fix is the copy of that code, replacing "times" with "divides".)

 I'll try to add the fix to the library, but it's my first time on boost
 trac, so I don't know how long that'll take.

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