Skip to content

Commit

Permalink
Merge pull request #856 from boostorg/norms
Browse files Browse the repository at this point in the history
Assert when features which require C++17 are compiled for an earlier …
  • Loading branch information
jzmaddock authored Nov 4, 2022
2 parents b08aa05 + 86c2491 commit cb32691
Show file tree
Hide file tree
Showing 25 changed files with 191 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/vector_functionals/norms.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

[section:norms Norms]

[note All of the functions below require at least C++17]

[heading Synopsis]

``
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/ccmath/abs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/ccmath/div.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/ccmath/fma.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/ccmath/isfinite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/ccmath/isinf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/ccmath/isnan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/ccmath/isnormal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/ccmath/round.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/ccmath/signbit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/differentiation/lanczos_smoothing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/filters/daubechies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/special_functions/daubechies_scaling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/special_functions/daubechies_wavelet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/special_functions/rsqrt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
7 changes: 7 additions & 0 deletions include/boost/math/statistics/signal_statistics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
7 changes: 7 additions & 0 deletions include/boost/math/tools/centered_continued_fraction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/tools/condition_numbers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/tools/engel_expansion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/tools/luroth_expansion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/tools/norms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/tools/signal_statistics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 7 additions & 0 deletions include/boost/math/tools/simple_continued_fraction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 8 additions & 0 deletions include/boost/math/tools/univariate_statistics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cb32691

Please sign in to comment.