From f7b9cb27553934928a699592faa342357c88b3c3 Mon Sep 17 00:00:00 2001 From: Luigi Ballabio Date: Mon, 18 May 2020 17:00:25 +0200 Subject: [PATCH] Try avoiding warnings in VC++13. --- ql/methods/finitedifferences/fdtypedefs.hpp | 9 +++++++++ ql/methods/finitedifferences/stepcondition.hpp | 13 ++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ql/methods/finitedifferences/fdtypedefs.hpp b/ql/methods/finitedifferences/fdtypedefs.hpp index 5771ceece80..3fcf2926238 100644 --- a/ql/methods/finitedifferences/fdtypedefs.hpp +++ b/ql/methods/finitedifferences/fdtypedefs.hpp @@ -43,12 +43,21 @@ namespace QuantLib { typedef StepCondition StandardStepCondition; +#if defined(QL_PATCH_MSVC) +#pragma warning(push) +#pragma warning(disable:4996) +#endif + /*! \deprecated Inherit from StandardStepCondition directly. Deprecated in version 1.19. */ QL_DEPRECATED typedef CurveDependentStepCondition StandardCurveDependentStepCondition; +#if defined(QL_PATCH_MSVC) +#pragma warning(pop) +#endif + } diff --git a/ql/methods/finitedifferences/stepcondition.hpp b/ql/methods/finitedifferences/stepcondition.hpp index 9655ae0f538..a2c579b8674 100644 --- a/ql/methods/finitedifferences/stepcondition.hpp +++ b/ql/methods/finitedifferences/stepcondition.hpp @@ -38,7 +38,7 @@ namespace QuantLib { virtual void applyTo(array_type& a, Time t) const = 0; }; - /* */ + /*! Abstract base class which allows step conditions to use both payoff and array functions. @@ -57,12 +57,23 @@ namespace QuantLib { } } protected: + +#if defined(QL_PATCH_MSVC) +#pragma warning(push) +#pragma warning(disable:4996) +#endif + CurveDependentStepCondition(Option::Type type, Real strike) : curveItem_(new PayoffWrapper(type, strike)) {}; CurveDependentStepCondition(const Payoff *p) : curveItem_(new PayoffWrapper(p)) {}; CurveDependentStepCondition(const array_type & a) : curveItem_(new ArrayWrapper(a)) {}; + +#if defined(QL_PATCH_MSVC) +#pragma warning(pop) +#endif + class CurveWrapper; ext::shared_ptr curveItem_;