Skip to content

Commit cb32691

Browse files
authored
Merge pull request #856 from boostorg/norms
Assert when features which require C++17 are compiled for an earlier …
2 parents b08aa05 + 86c2491 commit cb32691

25 files changed

+191
-0
lines changed

doc/vector_functionals/norms.qbk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
[section:norms Norms]
1010

11+
[note All of the functions below require at least C++17]
12+
1113
[heading Synopsis]
1214

1315
``

include/boost/math/ccmath/abs.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
#include <boost/math/ccmath/isnan.hpp>
1616
#include <boost/math/ccmath/isinf.hpp>
1717

18+
#include <boost/math/tools/is_standalone.hpp>
19+
#ifndef BOOST_MATH_STANDALONE
20+
#include <boost/config.hpp>
21+
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
22+
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
23+
#endif
24+
#endif
25+
1826
namespace boost::math::ccmath {
1927

2028
namespace detail {

include/boost/math/ccmath/div.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
#include <cstdint>
1313
#include <type_traits>
1414

15+
#include <boost/math/tools/is_standalone.hpp>
16+
#ifndef BOOST_MATH_STANDALONE
17+
#include <boost/config.hpp>
18+
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
19+
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
20+
#endif
21+
#endif
22+
1523
namespace boost::math::ccmath {
1624

1725
namespace detail {

include/boost/math/ccmath/fma.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313
#include <boost/math/ccmath/isinf.hpp>
1414
#include <boost/math/ccmath/isnan.hpp>
1515

16+
#include <boost/math/tools/is_standalone.hpp>
17+
#ifndef BOOST_MATH_STANDALONE
18+
#include <boost/config.hpp>
19+
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
20+
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
21+
#endif
22+
#endif
23+
1624
namespace boost::math::ccmath {
1725

1826
namespace detail {

include/boost/math/ccmath/isfinite.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
#include <boost/math/ccmath/isinf.hpp>
1313
#include <boost/math/ccmath/isnan.hpp>
1414

15+
#include <boost/math/tools/is_standalone.hpp>
16+
#ifndef BOOST_MATH_STANDALONE
17+
#include <boost/config.hpp>
18+
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
19+
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
20+
#endif
21+
#endif
22+
1523
namespace boost::math::ccmath {
1624

1725
template <typename T>

include/boost/math/ccmath/isinf.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
#include <type_traits>
1212
#include <boost/math/tools/is_constant_evaluated.hpp>
1313

14+
#include <boost/math/tools/is_standalone.hpp>
15+
#ifndef BOOST_MATH_STANDALONE
16+
#include <boost/config.hpp>
17+
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
18+
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
19+
#endif
20+
#endif
21+
1422
namespace boost::math::ccmath {
1523

1624
template <typename T>

include/boost/math/ccmath/isnan.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
#include <type_traits>
1111
#include <boost/math/tools/is_constant_evaluated.hpp>
1212

13+
#include <boost/math/tools/is_standalone.hpp>
14+
#ifndef BOOST_MATH_STANDALONE
15+
#include <boost/config.hpp>
16+
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
17+
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
18+
#endif
19+
#endif
20+
1321
namespace boost::math::ccmath {
1422

1523
template <typename T>

include/boost/math/ccmath/isnormal.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
#include <boost/math/ccmath/isinf.hpp>
1515
#include <boost/math/ccmath/isnan.hpp>
1616

17+
#include <boost/math/tools/is_standalone.hpp>
18+
#ifndef BOOST_MATH_STANDALONE
19+
#include <boost/config.hpp>
20+
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
21+
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
22+
#endif
23+
#endif
24+
1725
namespace boost::math::ccmath {
1826

1927
template <typename T>

include/boost/math/ccmath/round.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
#include <boost/math/ccmath/isnan.hpp>
1616
#include <boost/math/ccmath/modf.hpp>
1717

18+
#include <boost/math/tools/is_standalone.hpp>
19+
#ifndef BOOST_MATH_STANDALONE
20+
#include <boost/config.hpp>
21+
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
22+
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
23+
#endif
24+
#endif
25+
1826
namespace boost::math::ccmath {
1927

2028
namespace detail {

include/boost/math/ccmath/signbit.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
#include <boost/math/ccmath/isnan.hpp>
1717
#include <boost/math/ccmath/abs.hpp>
1818

19+
#include <boost/math/tools/is_standalone.hpp>
20+
#ifndef BOOST_MATH_STANDALONE
21+
#include <boost/config.hpp>
22+
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
23+
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
24+
#endif
25+
#endif
26+
1927
#ifdef __has_include
2028
# if __has_include(<bit>)
2129
# include <bit>

0 commit comments

Comments
 (0)