2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Apply VC-7.1 fixes: sometimes ADL fails, and we need a using declaration in order for the correct overload to be found.

Add missing #include. to t_distribution_inv.hpp.
Suppress unnecessary instantiations in instantiate_all.cpp.

[SVN r44748]
This commit is contained in:
John Maddock
2008-04-24 09:40:31 +00:00
parent c7e262f797
commit ffbb796900
5 changed files with 32 additions and 4 deletions

View File

@@ -416,6 +416,16 @@ inline long double real_cast<long double, concepts::real_concept>(concepts::real
#endif
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
//
// For some strange reason ADL sometimes fails to find the
// correct overloads, unless we bring these declarations into scope:
//
using concepts::itrunc;
using concepts::iround;
#endif
} // namespace math
} // namespace boost

View File

@@ -353,6 +353,15 @@ inline int digits<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_
} // namespace tools
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
using concepts::itrunc;
using concepts::ltrunc;
using concepts::lltrunc;
using concepts::iround;
using concepts::lround;
using concepts::llround;
#endif
} // namespace math
} // namespace boost

View File

@@ -13,6 +13,7 @@
#include <boost/math/special_functions/cbrt.hpp>
#include <boost/math/special_functions/round.hpp>
#include <boost/math/special_functions/trunc.hpp>
namespace boost{ namespace math{ namespace detail{

View File

@@ -16,6 +16,8 @@
#include <boost/math/special_functions.hpp>
#include <boost/math/concepts/distributions.hpp>
#ifndef BOOST_MATH_INSTANTIATE_MINIMUM
typedef boost::math::policies::policy<> test_policy;
namespace test{
@@ -29,6 +31,7 @@ namespace dist_test{
BOOST_MATH_DECLARE_DISTRIBUTIONS(double, test_policy)
}
#endif
namespace boost{ namespace math{
//
@@ -79,7 +82,7 @@ void instantiate(RealType)
function_requires<DistributionConcept<non_central_beta_distribution<RealType> > >();
function_requires<DistributionConcept<non_central_f_distribution<RealType> > >();
function_requires<DistributionConcept<non_central_t_distribution<RealType> > >();
#ifndef BOOST_MATH_INSTANTIATE_MINIMUM
function_requires<DistributionConcept<bernoulli_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<beta_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<binomial_distribution<RealType, test_policy> > >();
@@ -128,7 +131,7 @@ void instantiate(RealType)
function_requires<DistributionConcept<dist_test::non_central_beta > >();
function_requires<DistributionConcept<dist_test::non_central_f > >();
function_requires<DistributionConcept<dist_test::non_central_t > >();
#endif
int i;
RealType v1(0.5), v2(0.5), v3(0.5);
boost::math::tgamma(v1);
@@ -246,6 +249,7 @@ void instantiate(RealType)
boost::math::modf(v1, &ll);
#endif
boost::math::pow<2>(v1);
#ifndef BOOST_MATH_INSTANTIATE_MINIMUM
//
// All over again, with a policy this time:
//
@@ -483,6 +487,7 @@ void instantiate(RealType)
test::modf(v1, &ll);
#endif
test::pow<2>(v1);
#endif
}
template <class RealType>
@@ -490,7 +495,7 @@ void instantiate_mixed(RealType)
{
using namespace boost;
using namespace boost::math;
#ifndef BOOST_MATH_INSTANTIATE_MINIMUM
int i = 1;
long l = 1;
short s = 1;
@@ -839,6 +844,7 @@ void instantiate_mixed(RealType)
test::sph_bessel(i, 1);
test::sph_neumann(i, lr);
test::sph_neumann(i, i);
#endif
}

View File

@@ -14,8 +14,10 @@
// as that would lead to recursive project dependencies...
//
#include "../test/compile_test/instantiate.hpp"
#define BOOST_MATH_ASSERT_UNDEFINED_POLICY false
#define BOOST_MATH_INSTANTIATE_MINIMUM
#include <boost/math/concepts/real_concept.hpp>
#include "../test/compile_test/instantiate.hpp"
void some_proc()
{