Index: detail/mpl/gcd.hpp =================================================================== --- detail/mpl/gcd.hpp (revision 79258) +++ detail/mpl/gcd.hpp (working copy) @@ -20,6 +20,8 @@ #include #include #include +#include +#include #if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2) \ && !defined(BOOST_MPL_PREPROCESSING_MODE) \ @@ -65,7 +67,30 @@ { }; +// Workaround for error: the type of partial specialization template parameter constant "n2" +// depends on another template parameter +// Note: this solution could be wrong for n1 or n2 = [2**63 .. 2**64-1] +#if defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC) + namespace aux { + template< typename T1, boost::intmax_t n1, bool n1_is_0 + , typename T2, boost::intmax_t n2, bool n2_is_0 > + struct gcd_aux + : gcd_aux + {}; + + template + struct gcd_aux : integral_c + {}; + + template + struct gcd_aux : integral_c + {}; +} + +#else // defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC) + +namespace aux { template< typename T1, T1 n1, bool n1_is_0, typename T2, T2 n2, bool n2_is_0 > struct gcd_aux @@ -84,6 +109,8 @@ {}; } +#endif // defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC) + template<> struct gcd_impl { Index: detail/mpl/lcm.hpp =================================================================== --- detail/mpl/lcm.hpp (revision 79258) +++ detail/mpl/lcm.hpp (working copy) @@ -20,6 +20,8 @@ #include #include #include +#include +#include #if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2) \ && !defined(BOOST_MPL_PREPROCESSING_MODE) \ @@ -66,7 +68,32 @@ }; +// Workaround for error: the type of partial specialization template parameter constant "n2" +// depends on another template parameter +// Note: this solution could be wrong for n1 or n2 = [2**63 .. 2**64-1] +#if defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC) + namespace aux { + template< typename T1, boost::intmax_t n1, bool n1_is_0 + , typename T2, boost::intmax_t n2, bool n2_is_0 > + struct lcm_aux + : abs::type, + ( n1 / gcd, integral_c >::value * n2 ) + > > + {}; + + template + struct lcm_aux : integral_c + {}; + + template + struct lcm_aux : integral_c + {}; +} + +#else // defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC) + +namespace aux { template< typename T1, T1 n1, bool n1_is_0, typename T2, T2 n2, bool n2_is_0 > struct lcm_aux @@ -84,6 +111,8 @@ {}; } +#endif // defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC) + template<> struct lcm_impl {