2
0
mirror of https://github.com/boostorg/math.git synced 2026-02-15 13:12:19 +00:00
Files
math/test/compile_test/distribution_concept_check.cpp
John Maddock 69031ebe9d Added static assertion to catch use of long double function overloads when BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS is defined.
Made sure that if BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS is defined, then no long double overloads are actually instantiated by the tests.

[SVN r41007]
2007-11-11 14:05:50 +00:00

50 lines
2.2 KiB
C++

// Copyright John Maddock 2006.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#define BOOST_MATH_ASSERT_UNDEFINED_POLICY false
#include <boost/math/distributions.hpp>
#include <boost/math/concepts/distributions.hpp>
template <class RealType>
void instantiate(RealType)
{
using namespace boost;
using namespace boost::math;
using namespace boost::math::concepts;
function_requires<DistributionConcept<normal_distribution<RealType> > >();
function_requires<DistributionConcept<beta_distribution<RealType> > >();
function_requires<DistributionConcept<binomial_distribution<RealType> > >();
function_requires<DistributionConcept<cauchy_distribution<RealType> > >();
function_requires<DistributionConcept<bernoulli_distribution<RealType> > >();
function_requires<DistributionConcept<chi_squared_distribution<RealType> > >();
function_requires<DistributionConcept<exponential_distribution<RealType> > >();
function_requires<DistributionConcept<extreme_value_distribution<RealType> > >();
function_requires<DistributionConcept<fisher_f_distribution<RealType> > >();
function_requires<DistributionConcept<gamma_distribution<RealType> > >();
function_requires<DistributionConcept<students_t_distribution<RealType> > >();
function_requires<DistributionConcept<pareto_distribution<RealType> > >();
function_requires<DistributionConcept<poisson_distribution<RealType> > >();
function_requires<DistributionConcept<rayleigh_distribution<RealType> > >();
function_requires<DistributionConcept<weibull_distribution<RealType> > >();
function_requires<DistributionConcept<lognormal_distribution<RealType> > >();
function_requires<DistributionConcept<triangular_distribution<RealType> > >();
function_requires<DistributionConcept<uniform_distribution<RealType> > >();
function_requires<DistributionConcept<negative_binomial_distribution<RealType> > >();
}
int main()
{
instantiate(float(0));
instantiate(double(0));
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
instantiate((long double)(0));
#endif
}