[Units] Unable to raise constant to power of two

In the attached code I am trying to take a constant physical unit and
raise it to a power of two. The compiler is complaining that it cannot
find a template to satisfy multiply_typeof_helper. It says that there
are more than one partial specialization that matches the template
argument list. I read something on the web about there was no pow
operation for constants. The solution to that problem was to upgrade
to Boost 1.48. Unforunately I am constrained to using Boost 1.45. What
is an work around for this problem?
Here is the compiler output with the file attached:
1>------ Build started: Project: boost_units, Configuration: Debug Win32 ------
1>Compiling...
1>boost_units.cpp
1>C:\boost\boost/units/detail/static_rational_power.hpp(126) : error
C2752: 'boost::units::multiply_typeof_helper

AMDG On 12/05/2011 07:09 AM, Stephen Torri wrote:
In the attached code I am trying to take a constant physical unit and raise it to a power of two. The compiler is complaining that it cannot find a template to satisfy multiply_typeof_helper. It says that there are more than one partial specialization that matches the template argument list. I read something on the web about there was no pow operation for constants. The solution to that problem was to upgrade to Boost 1.48. Unforunately I am constrained to using Boost 1.45. What is an work around for this problem?
Fixed in the trunk in r75814. In Christ, Steven Watanabe

Steven,
That is good to hear. Unfortunately I cannot use anything but 1.45.
How do you advise me to deal with this issue?
Stephen
On 12/5/11, Steven Watanabe
AMDG
On 12/05/2011 07:09 AM, Stephen Torri wrote:
In the attached code I am trying to take a constant physical unit and raise it to a power of two. The compiler is complaining that it cannot find a template to satisfy multiply_typeof_helper. It says that there are more than one partial specialization that matches the template argument list. I read something on the web about there was no pow operation for constants. The solution to that problem was to upgrade to Boost 1.48. Unforunately I am constrained to using Boost 1.45. What is an work around for this problem?
Fixed in the trunk in r75814.
In Christ, Steven Watanabe _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

In the attached code I am trying to take a constant physical unit and raise it to a power of two. The compiler is complaining that it cannot find a template to satisfy multiply_typeof_helper. It says that there are more than one partial specialization that matches the template argument list. I read something on the web about there was no pow operation for constants. The solution to that problem was to upgrade to Boost 1.48. Unforunately I am constrained to using Boost 1.45. What is an work around for this problem?'
You also should probably not be replicating the, perhaps overly, complicated constants infrastructure; for user code, you can just as easily do: static const quantity<blah> const(somevalue); This should sidestep the missing function problem and other subtle issues... Matthias
participants (3)
-
Matthias Schabel
-
Stephen Torri
-
Steven Watanabe