2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-24 18:12:09 +00:00

Move C++03 deprecation warnings to separate file and only warn for headers that need it.

This commit is contained in:
jzmaddock
2020-03-26 18:15:53 +00:00
parent f4300bdc9d
commit 49dfd1f535
17 changed files with 47 additions and 19 deletions

View File

@@ -8,6 +8,7 @@
#define BOOST_MATH_CONSTANTS_CONSTANTS_INCLUDED
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/cxx03_warn.hpp>
#include <boost/math/policies/policy.hpp>
#include <boost/math/tools/precision.hpp>
#include <boost/math/tools/convert_from_string.hpp>

View File

@@ -19,6 +19,7 @@
#include <complex>
#include <boost/math/constants/constants.hpp>
#include <boost/math/tools/cxx03_warn.hpp>
namespace std
{

View File

@@ -17,6 +17,7 @@
#include <boost/config.hpp>
#include <boost/math/tools/cxx03_warn.hpp>
#include <boost/math/distributions/complement.hpp>
#include <boost/math/distributions/detail/common_error_handling.hpp>
#include <boost/math/distributions/exponential.hpp>

View File

@@ -21,6 +21,7 @@
#include <boost/math/constants/constants.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/math/policies/error_handling.hpp>
#include <boost/math/tools/cxx03_warn.hpp>
namespace boost{ namespace math{ namespace quadrature {

View File

@@ -25,6 +25,7 @@
#include <boost/math/special_functions/sinc.hpp> // for the Sinus cardinal
#include <boost/math/special_functions/sinhc.hpp> // for the Hyperbolic Sinus cardinal
#include <boost/math/tools/cxx03_warn.hpp>
#if defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_NO_SFINAE_EXPR)
#include <boost/type_traits/is_pod.hpp>

View File

@@ -12,6 +12,7 @@
#include <boost/math/tools/atomic.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/math/tools/toms748_solve.hpp>
#include <boost/math/tools/cxx03_warn.hpp>
#include <vector>
namespace boost{ namespace math{ namespace detail{

View File

@@ -22,6 +22,7 @@
#endif
#include <cmath>
#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/math/tools/cxx03_warn.hpp>
#ifdef BOOST_MATH_HAVE_CONSTEXPR_TABLES
#include <array>

View File

@@ -62,6 +62,7 @@ BOOST_MATH_INSTRUMENT_LAMBERT_W_SMALL_Z_SERIES_ITERATIONS // Show evaluation of
#include <boost/type_traits/is_integral.hpp>
#include <boost/math/tools/precision.hpp> // boost::math::tools::max_value().
#include <boost/math/tools/big_constant.hpp>
#include <boost/math/tools/cxx03_warn.hpp>
#include <limits>
#include <cmath>

View File

@@ -17,6 +17,7 @@
#include <boost/math/special_functions/factorials.hpp>
#include <boost/math/tools/roots.hpp>
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/cxx03_warn.hpp>
namespace boost{
namespace math{

View File

@@ -8,6 +8,7 @@
#define BOOST_MATH_ATOMIC_DETAIL_HPP
#include <boost/config.hpp>
#include <boost/math/tools/cxx03_warn.hpp>
#ifdef BOOST_HAS_THREADS

View File

@@ -26,25 +26,6 @@
# include <limits>
#endif
#if defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_NO_SFINAE_EXPR)\
|| defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) || defined(BOOST_NO_CXX11_LAMBDAS) || defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)\
|| defined(BOOST_NO_CXX11_HDR_TUPLE) || defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) || defined(BOOST_NO_CXX11_HDR_CHRONO)\
|| defined(BOOST_NO_CXX11_THREAD_LOCAL) || defined(BOOST_NO_CXX11_CONSTEXPR) || defined(BOOST_NO_CXX11_NULLPTR)\
|| defined(BOOST_NO_CXX11_NUMERIC_LIMITS) || defined(BOOST_NO_CXX11_DECLTYPE) || defined(BOOST_NO_CXX11_HDR_ARRAY)\
|| defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_NO_CXX11_HDR_ATOMIC) || defined(BOOST_NO_CXX11_NOEXCEPT)\
|| defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
//
// The above list includes everything we use, plus a few we're likely to use soon.
// As from March 2020, C++03 support is deprecated, and as from March 2021 will be removed,
// so mark up as such:
//
#if (defined(_MSC_VER) || defined(__GNUC__)) && !defined(BOOST_MATH_DISABLE_DEPRECATED_03_WARNING)
#pragma message("CAUTION: One or more C++11 features were found to be unavailable")
#pragma message("CAUTION: Compiling Boost.Math in pre-C++11 conformance modes is now deprecated and will be removed from March 2021.")
#pragma message("CAUTION: Define BOOST_MATH_DISABLE_DEPRECATED_03_WARNING to suppress this message.")
#endif
#endif
#include <boost/math/tools/user.hpp>
#if (defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__NetBSD__) \

View File

@@ -0,0 +1,30 @@
// Copyright (c) 2020 John Maddock
// 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)
#ifndef BOOST_MATH_TOOLS_CXX03_WARN_HPP
#define BOOST_MATH_TOOLS_CXX03_WARN_HPP
#include <boost/config/pragma_message.hpp>
#if defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_NO_SFINAE_EXPR)\
|| defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) || defined(BOOST_NO_CXX11_LAMBDAS) || defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)\
|| defined(BOOST_NO_CXX11_HDR_TUPLE) || defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) || defined(BOOST_NO_CXX11_HDR_CHRONO)\
|| defined(BOOST_NO_CXX11_THREAD_LOCAL) || defined(BOOST_NO_CXX11_CONSTEXPR) || defined(BOOST_NO_CXX11_NULLPTR)\
|| defined(BOOST_NO_CXX11_NUMERIC_LIMITS) || defined(BOOST_NO_CXX11_DECLTYPE) || defined(BOOST_NO_CXX11_HDR_ARRAY)\
|| defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_NO_CXX11_HDR_ATOMIC) || defined(BOOST_NO_CXX11_NOEXCEPT)\
|| defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
//
// The above list includes everything we use, plus a few we're likely to use soon.
// As from March 2020, C++03 support is deprecated, and as from March 2021 will be removed,
// so mark up as such:
//
#if (defined(_MSC_VER) || defined(__GNUC__)) && !defined(BOOST_MATH_DISABLE_DEPRECATED_03_WARNING)
BOOST_PRAGMA_MESSAGE("CAUTION: One or more C++11 features were found to be unavailable")
BOOST_PRAGMA_MESSAGE("CAUTION: Compiling Boost.Math in pre-C++11 conformance modes is now deprecated and will be removed from March 2021.")
BOOST_PRAGMA_MESSAGE("CAUTION: Define BOOST_MATH_DISABLE_DEPRECATED_03_WARNING to suppress this message.")
#endif
#endif
#endif

View File

@@ -6,6 +6,9 @@
#ifndef BOOST_MATH_TOOLS_IS_CONST_ITERABLE_HPP
#define BOOST_MATH_TOOLS_IS_CONST_ITERABLE_HPP
#include <boost/config.hpp>
#include <boost/math/tools/cxx03_warn.hpp>
#if !defined(BOOST_NO_CXX14_VARIABLE_TEMPLATES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_SFINAE_EXPR)
#define BOOST_MATH_HAS_IS_CONST_ITERABLE

View File

@@ -15,6 +15,7 @@
#include <boost/assert.hpp>
#include <boost/config.hpp>
#include <boost/math/tools/cxx03_warn.hpp>
#ifdef BOOST_NO_CXX11_LAMBDAS
#include <boost/lambda/lambda.hpp>
#endif

View File

@@ -10,6 +10,7 @@
#include <boost/math/tools/precision.hpp>
#include <boost/math/tools/tuple.hpp>
#include <boost/math/tools/fraction.hpp>
#include <boost/math/tools/cxx03_warn.hpp>
#ifdef BOOST_NO_CXX11_HDR_TUPLE
#error "This header requires C++11 support"

View File

@@ -20,6 +20,7 @@
#include <boost/cstdint.hpp>
#include <boost/assert.hpp>
#include <boost/throw_exception.hpp>
#include <boost/math/tools/cxx03_warn.hpp>
#ifdef BOOST_MSVC
#pragma warning(push)

View File

@@ -7,6 +7,7 @@
# define BOOST_MATH_TUPLE_HPP_INCLUDED
# include <boost/config.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/math/tools/cxx03_warn.hpp>
#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500)