Skip to content

Commit

Permalink
Deprecate another old-framework class.
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Jan 29, 2021
1 parent d7ea211 commit 2e4c41f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ql/methods/finitedifferences/americancondition.hpp
Expand Up @@ -32,8 +32,10 @@
namespace QuantLib {

//! American exercise condition.
class AmericanCondition :
public StandardStepCondition {
/*! \deprecated Use the new finite-differences framework instead.
Deprecated in version 1.22.
*/
class QL_DEPRECATED AmericanCondition : public StandardStepCondition {
public:
explicit AmericanCondition(const Array& intrinsicValues)
: impl_(new ArrayImpl(intrinsicValues)) {}
Expand Down
27 changes: 26 additions & 1 deletion ql/pricingengines/vanilla/fdconditions.hpp
Expand Up @@ -32,7 +32,7 @@

namespace QuantLib {

/*! \deprecated Use the new framework instead.
/*! \deprecated Use the new finite-differences framework instead.
Deprecated in version 1.22.
*/
template <typename baseEngine>
Expand All @@ -45,9 +45,34 @@ namespace QuantLib {
: baseEngine(process, timeSteps, gridPoints, timeDependent) {}
protected:
void initializeStepCondition() const {

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
#if defined(QL_PATCH_MSVC)
#pragma warning(push)
#pragma warning(disable:4996)
#endif

baseEngine::stepCondition_ =
ext::shared_ptr<StandardStepCondition>(
new AmericanCondition(baseEngine::intrinsicValues_.values()));

#if defined(QL_PATCH_MSVC)
#pragma warning(pop)
#endif
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

}
};

Expand Down

0 comments on commit 2e4c41f

Please sign in to comment.