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' : more than one
partial specialization matches the template argument list
1> with
1> [
1> X=boost::units::quantitymyproject::second_types::squared_radii_unit,
1> Y=boost::units::one
1> ]
1> C:\boost\boost/units/quantity.hpp(689): could be
'boost::units::multiply_typeof_helper,Y>'
1> C:\boost\boost/units/detail/one.hpp(36): or
'boost::units::multiply_typeof_helper'
1> C:\boost\boost/units/detail/static_rational_power.hpp(93) :
see reference to class template instantiation
'boost::units::detail::static_int_power_impl<1,false>::apply'
being compiled
1> with
1> [
1> Y=boost::units::quantitymyproject::second_types::squared_radii_unit,
1> R=boost::units::one
1> ]
1> C:\boost\boost/units/detail/static_rational_power.hpp(158) :
see reference to class template instantiation
'boost::units::detail::static_int_power_impl<N>::apply' being
compiled
1> with
1> [
1> N=2,
1> Y=boost::units::constantmyproject::second_types::equatorial_radius_of_earth_t>,
1> R=boost::units::one
1> ]
1> C:\boost\boost/units/detail/static_rational_power.hpp(187) :
see reference to class template instantiation
'boost::units::detail::static_int_power_sign_impl<N>::apply<Y>' being
compiled
1> with
1> [
1> N=2,
1> Y=boost::units::constantmyproject::second_types::equatorial_radius_of_earth_t>
1> ]
1> C:\boost\boost/units/pow.hpp(52) : see reference to class
template instantiation
'boost::units::detail::static_rational_power_impl' being compiled
1> with
1> [
1> R=boost::units::static_rational<2>,
1> Y=boost::units::constantmyproject::second_types::equatorial_radius_of_earth_t>
1> ]
1> ..\..\..\apps\boost_units\boost_units.cpp(104) : see
reference to class template instantiation
'boost::units::power_typeof_helper' being compiled
1> with
1> [
1> X=boost::units::constantmyproject::second_types::equatorial_radius_of_earth_t>,
1> Y=boost::units::static_rational<2>
1> ]
1>Build log was saved at "file://c:\documents and
settings\stephen.torri\my documents\visual studio
2008\projects\satsim_boost_units\vs2008\apps\boost_units\boost_units.dir\Debug\BuildLog.htm"
1>boost_units - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
Regards,
Stephen