diff --git a/ql/qldefines.hpp b/ql/qldefines.hpp index e3cee317fd5..7c2cc7af45c 100644 --- a/ql/qldefines.hpp +++ b/ql/qldefines.hpp @@ -168,7 +168,7 @@ /*! \def QL_EPSILON Defines the machine precision for operations over doubles */ -#include +#include // limits used as such #define QL_MIN_INTEGER ((std::numeric_limits::min)()) #define QL_MAX_INTEGER ((std::numeric_limits::max)()) @@ -176,8 +176,15 @@ #define QL_MAX_REAL ((std::numeric_limits::max)()) #define QL_MIN_POSITIVE_REAL ((std::numeric_limits::min)()) #define QL_EPSILON ((std::numeric_limits::epsilon)()) -// specific values---these should fit into any Integer or Real +/*! \def QL_NULL_INTEGER + \deprecated Don't use this macro. + Deprecated in version 1.27. +*/ #define QL_NULL_INTEGER ((std::numeric_limits::max)()) +/*! \def QL_NULL_REAL + \deprecated Don't use this macro. + Deprecated in version 1.27. +*/ #define QL_NULL_REAL ((std::numeric_limits::max)()) /*! @} */ diff --git a/ql/timeseries.hpp b/ql/timeseries.hpp index 2b339ac7a6d..46a521a6f0f 100644 --- a/ql/timeseries.hpp +++ b/ql/timeseries.hpp @@ -35,6 +35,7 @@ #include #include #include +#include namespace QuantLib { @@ -147,10 +148,8 @@ namespace QuantLib { // bidirectional_iterator_tag category. typedef typename boost::mpl::if_ < boost::mpl::or_ < - boost::is_same, - boost::is_base_of >, + std::is_same, + std::is_base_of >, std::bidirectional_iterator_tag, std::input_iterator_tag>::type enable_reverse; diff --git a/ql/utilities/dataformatters.hpp b/ql/utilities/dataformatters.hpp index 53b4057e5eb..c88ffd46ca5 100644 --- a/ql/utilities/dataformatters.hpp +++ b/ql/utilities/dataformatters.hpp @@ -25,7 +25,7 @@ #define quantlib_data_formatters_hpp #include -#include +#include namespace QuantLib { diff --git a/ql/utilities/null.hpp b/ql/utilities/null.hpp index 98ea0c7006d..d3c54e7c80c 100644 --- a/ql/utilities/null.hpp +++ b/ql/utilities/null.hpp @@ -27,17 +27,8 @@ #define quantlib_null_hpp #include - -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-local-typedefs" -#endif - -#include - -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)) -#pragma GCC diagnostic pop -#endif +#include +#include namespace QuantLib { @@ -55,7 +46,8 @@ namespace QuantLib { template <> struct FloatingPointNull { constexpr static float nullValue() { - return QL_NULL_REAL; + // a specific values that should fit into any Real + return (std::numeric_limits::max)(); } }; @@ -63,7 +55,8 @@ namespace QuantLib { template <> struct FloatingPointNull { constexpr static int nullValue() { - return QL_NULL_INTEGER; + // a specific values that should fit into any Integer + return (std::numeric_limits::max)(); } }; @@ -75,8 +68,7 @@ namespace QuantLib { public: constexpr Null() = default; constexpr operator T() const { - return T(detail::FloatingPointNull< - boost::is_floating_point::value>::nullValue()); + return T(detail::FloatingPointNull::value>::nullValue()); } };