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

Assert when features which require C++17 are compiled for an earlier C++ version.

Also document C++17 requirement for norms.
This commit is contained in:
jzmaddock
2022-10-25 18:51:29 +01:00
parent a8f0f0a1e2
commit 86c24916b2
25 changed files with 191 additions and 0 deletions

View File

@@ -8,6 +8,8 @@
[section:norms Norms]
[note All of the functions below require at least C++17]
[heading Synopsis]
``

View File

@@ -15,6 +15,14 @@
#include <boost/math/ccmath/isnan.hpp>
#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math::ccmath {
namespace detail {

View File

@@ -12,6 +12,14 @@
#include <cstdint>
#include <type_traits>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math::ccmath {
namespace detail {

View File

@@ -13,6 +13,14 @@
#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/ccmath/isnan.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math::ccmath {
namespace detail {

View File

@@ -12,6 +12,14 @@
#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/ccmath/isnan.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math::ccmath {
template <typename T>

View File

@@ -11,6 +11,14 @@
#include <type_traits>
#include <boost/math/tools/is_constant_evaluated.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math::ccmath {
template <typename T>

View File

@@ -10,6 +10,14 @@
#include <type_traits>
#include <boost/math/tools/is_constant_evaluated.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math::ccmath {
template <typename T>

View File

@@ -14,6 +14,14 @@
#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/ccmath/isnan.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math::ccmath {
template <typename T>

View File

@@ -15,6 +15,14 @@
#include <boost/math/ccmath/isnan.hpp>
#include <boost/math/ccmath/modf.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math::ccmath {
namespace detail {

View File

@@ -16,6 +16,14 @@
#include <boost/math/ccmath/isnan.hpp>
#include <boost/math/ccmath/abs.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
#ifdef __has_include
# if __has_include(<bit>)
# include <bit>

View File

@@ -14,6 +14,14 @@
#include <type_traits>
#include <boost/math/tools/assert.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math::differentiation {
namespace detail {

View File

@@ -11,6 +11,14 @@
#include <type_traits>
#include <utility>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost { namespace math{
template<class RandomAccessContainer>

View File

@@ -10,6 +10,14 @@
#include <limits>
#include <boost/math/tools/big_constant.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math::filters {
template <typename Real, unsigned p>

View File

@@ -19,6 +19,14 @@
#include <boost/math/interpolators/detail/quintic_hermite_detail.hpp>
#include <boost/math/interpolators/detail/septic_hermite_detail.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math {
template<class Real, int p, int order>

View File

@@ -21,6 +21,14 @@
#include <boost/math/interpolators/detail/quintic_hermite_detail.hpp>
#include <boost/math/interpolators/detail/septic_hermite_detail.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math {
template<class Real, int p, int order>

View File

@@ -9,6 +9,14 @@
#include <type_traits>
#include <limits>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math {
template<typename Real>

View File

@@ -13,6 +13,13 @@
#include <boost/math/tools/roots.hpp>
#include <boost/math/statistics/univariate_statistics.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math::statistics {

View File

@@ -18,6 +18,13 @@
#include <type_traits>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
#ifndef BOOST_MATH_STANDALONE
#include <boost/core/demangle.hpp>
#endif

View File

@@ -9,6 +9,14 @@
#include <limits>
#include <boost/math/differentiation/finite_difference.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math::tools {
template<class Real, bool kahan=true>

View File

@@ -14,6 +14,14 @@
#include <limits>
#include <stdexcept>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math::tools {
template<typename Real, typename Z = int64_t>

View File

@@ -13,6 +13,14 @@
#include <limits>
#include <stdexcept>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math::tools {
template<typename Real, typename Z = int64_t>

View File

@@ -12,6 +12,14 @@
#include <boost/math/tools/assert.hpp>
#include <boost/math/tools/complex.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
namespace boost::math::tools {

View File

@@ -14,6 +14,14 @@
#include <boost/math/tools/header_deprecated.hpp>
#include <boost/math/statistics/univariate_statistics.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
BOOST_MATH_HEADER_DEPRECATED("<boost/math/statistics/signal_statistics.hpp>");
namespace boost::math::tools {

View File

@@ -14,7 +14,14 @@
#include <limits>
#include <stdexcept>
#include <sstream>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
#ifndef BOOST_MATH_STANDALONE
#include <boost/core/demangle.hpp>

View File

@@ -12,6 +12,14 @@
#include <boost/math/tools/assert.hpp>
#include <boost/math/tools/header_deprecated.hpp>
#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#endif
BOOST_MATH_HEADER_DEPRECATED("<boost/math/statistics/univariate_statistics.hpp>");
namespace boost::math::tools {