diff --git a/ql/instruments/zerocouponinflationswap.cpp b/ql/instruments/zerocouponinflationswap.cpp index 9e5f7e1a8a2..ca2d0e24781 100644 --- a/ql/instruments/zerocouponinflationswap.cpp +++ b/ql/instruments/zerocouponinflationswap.cpp @@ -117,50 +117,6 @@ namespace QuantLib { } } - ZeroCouponInflationSwap::ZeroCouponInflationSwap( - Type type, - Real nominal, - const Date& startDate, - const Date& maturity, - Calendar fixCalendar, - BusinessDayConvention fixConvention, - DayCounter dayCounter, - Rate fixedRate, - const ext::shared_ptr& infIndex, - const Period& observationLag, - bool adjustInfObsDates, - Calendar infCalendar, - BusinessDayConvention infConvention) - : ZeroCouponInflationSwap(type, - nominal, - startDate, - maturity, - std::move(fixCalendar), - fixConvention, - std::move(dayCounter), - fixedRate, - infIndex, - observationLag, - CPI::AsIndex, - adjustInfObsDates, - std::move(infCalendar), - infConvention) {} - - - void ZeroCouponInflationSwap::setupArguments(PricingEngine::arguments* args) const { - Swap::setupArguments(args); - // you don't actually need to do anything else because it is so simple - } - - void ZeroCouponInflationSwap::arguments::validate() const { - Swap::arguments::validate(); - // you don't actually need to do anything else because it is so simple - } - - void ZeroCouponInflationSwap::fetchResults(const PricingEngine::results* r) const { - Swap::fetchResults(r); - // you don't actually need to do anything else because it is so simple - } Real ZeroCouponInflationSwap::fairRate() const { // What does this mean before or after trade date? diff --git a/ql/instruments/zerocouponinflationswap.hpp b/ql/instruments/zerocouponinflationswap.hpp index 54a0cac7327..30dbe64416b 100644 --- a/ql/instruments/zerocouponinflationswap.hpp +++ b/ql/instruments/zerocouponinflationswap.hpp @@ -85,24 +85,6 @@ namespace QuantLib { Calendar infCalendar = Calendar(), BusinessDayConvention infConvention = BusinessDayConvention()); - /*! \deprecated Use the other constructor. - Deprecated in version 1.23. - */ - QL_DEPRECATED - ZeroCouponInflationSwap(Type type, - Real nominal, - const Date& startDate, // start date of contract (only) - const Date& maturity, // this is pre-adjustment! - Calendar fixCalendar, - BusinessDayConvention fixConvention, - DayCounter dayCounter, - Rate fixedRate, - const ext::shared_ptr& infIndex, - const Period& observationLag, - bool adjustInfObsDates = false, - Calendar infCalendar = Calendar(), - BusinessDayConvention infConvention = BusinessDayConvention()); - //! \name Inspectors //@{ //! "Payer" or "Receiver" refers to the inflation leg @@ -135,12 +117,6 @@ namespace QuantLib { const Leg& inflationLeg() const; //@} - //! \name Instrument interface - //@{ - void setupArguments(PricingEngine::arguments*) const override; - void fetchResults(const PricingEngine::results* r) const override; - //@} - //! \name Results //@{ Real fixedLegNPV() const; @@ -169,13 +145,12 @@ namespace QuantLib { class ZeroCouponInflationSwap::arguments : public Swap::arguments { public: Rate fixedRate; - void validate() const override; }; class ZeroCouponInflationSwap::engine : public GenericEngine {}; + ZeroCouponInflationSwap::results> {}; } diff --git a/ql/termstructures/inflation/inflationhelpers.cpp b/ql/termstructures/inflation/inflationhelpers.cpp index 1d866b48a87..0ac78589c19 100644 --- a/ql/termstructures/inflation/inflationhelpers.cpp +++ b/ql/termstructures/inflation/inflationhelpers.cpp @@ -71,30 +71,7 @@ namespace QuantLib { } - ZeroCouponInflationSwapHelper::ZeroCouponInflationSwapHelper( - const Handle& quote, - const Period& swapObsLag, - const Date& maturity, - Calendar calendar, - BusinessDayConvention paymentConvention, - DayCounter dayCounter, - ext::shared_ptr zii, - Handle nominalTermStructure) - : ZeroCouponInflationSwapHelper(quote, - swapObsLag, - maturity, - std::move(calendar), - paymentConvention, - std::move(dayCounter), - std::move(zii), - CPI::AsIndex, - std::move(nominalTermStructure)) {} - - Real ZeroCouponInflationSwapHelper::impliedQuote() const { - // what does the term structure imply? - // in this case just the same value ... trivial case - // (would not be so for an inflation-linked bond) zciis_->recalculate(); return zciis_->fairRate(); } diff --git a/ql/termstructures/inflation/inflationhelpers.hpp b/ql/termstructures/inflation/inflationhelpers.hpp index 1a63c85b209..aa30c86e82e 100644 --- a/ql/termstructures/inflation/inflationhelpers.hpp +++ b/ql/termstructures/inflation/inflationhelpers.hpp @@ -46,20 +46,6 @@ namespace QuantLib { CPI::InterpolationType observationInterpolation, Handle nominalTermStructure); - /*! \deprecated Use the other constructor. - Deprecated in version 1.23. - */ - QL_DEPRECATED - ZeroCouponInflationSwapHelper( - const Handle& quote, - const Period& swapObsLag, // lag on swap observation of index - const Date& maturity, - Calendar calendar, // index may have null calendar as valid on every day - BusinessDayConvention paymentConvention, - DayCounter dayCounter, - ext::shared_ptr zii, - Handle nominalTermStructure); - void setTermStructure(ZeroInflationTermStructure*) override; Real impliedQuote() const override; diff --git a/ql/time/daycounters/actualactual.hpp b/ql/time/daycounters/actualactual.hpp index e35af6cd920..db01ceb3f21 100644 --- a/ql/time/daycounters/actualactual.hpp +++ b/ql/time/daycounters/actualactual.hpp @@ -87,17 +87,9 @@ namespace QuantLib { Time yearFraction(const Date& d1, const Date& d2, const Date&, const Date&) const override; }; - static ext::shared_ptr implementation( - Convention c, - const Schedule& schedule); + static ext::shared_ptr implementation(Convention c, + const Schedule& schedule); public: - /*! \deprecated Use the other constructor. - Deprecated in version 1.23. - */ - QL_DEPRECATED - ActualActual() - : DayCounter(implementation(ActualActual::ISDA, Schedule())) {} - explicit ActualActual(Convention c, const Schedule& schedule = Schedule()) : DayCounter(implementation(c, schedule)) {} diff --git a/ql/time/daycounters/thirty360.cpp b/ql/time/daycounters/thirty360.cpp index c03a437577a..39d630aeccc 100644 --- a/ql/time/daycounters/thirty360.cpp +++ b/ql/time/daycounters/thirty360.cpp @@ -32,7 +32,7 @@ namespace QuantLib { } ext::shared_ptr - Thirty360::implementation(Thirty360::Convention c, const Date& terminationDate, bool isLastPeriod) { + Thirty360::implementation(Thirty360::Convention c, const Date& terminationDate) { switch (c) { case USA: return ext::shared_ptr(new US_Impl); @@ -46,7 +46,7 @@ namespace QuantLib { return ext::shared_ptr(new ISMA_Impl); case ISDA: case German: - return ext::shared_ptr(new ISDA_Impl(terminationDate, isLastPeriod)); + return ext::shared_ptr(new ISDA_Impl(terminationDate)); case NASD: return ext::shared_ptr(new NASD_Impl); default: @@ -119,9 +119,7 @@ namespace QuantLib { if (isLastOfFebruary(dd1, mm1, yy1)) { dd1 = 30; } - bool isTerminationDate = - terminationDate_ == Date() ? isLastPeriod_ : d2 == terminationDate_; - if (!isTerminationDate && isLastOfFebruary(dd2, mm2, yy2)) { dd2 = 30; } + if (d2 != terminationDate_ && isLastOfFebruary(dd2, mm2, yy2)) { dd2 = 30; } return 360*(yy2-yy1) + 30*(mm2-mm1) + (dd2-dd1); } diff --git a/ql/time/daycounters/thirty360.hpp b/ql/time/daycounters/thirty360.hpp index e520ee773bd..0f0863dd408 100644 --- a/ql/time/daycounters/thirty360.hpp +++ b/ql/time/daycounters/thirty360.hpp @@ -116,13 +116,12 @@ namespace QuantLib { }; class ISDA_Impl : public Thirty360_Impl { public: - explicit ISDA_Impl(const Date& terminationDate, bool isLastPeriod) - : terminationDate_(terminationDate), isLastPeriod_(isLastPeriod) {} + explicit ISDA_Impl(const Date& terminationDate) + : terminationDate_(terminationDate) {} std::string name() const override { return std::string("30E/360 (ISDA)"); } Date::serial_type dayCount(const Date& d1, const Date& d2) const override; private: Date terminationDate_; - bool isLastPeriod_; }; class NASD_Impl : public Thirty360_Impl { public: @@ -130,24 +129,10 @@ namespace QuantLib { Date::serial_type dayCount(const Date& d1, const Date& d2) const override; }; static ext::shared_ptr - implementation(Convention c, const Date& terminationDate, bool isLastPeriod); + implementation(Convention c, const Date& terminationDate); public: - /*! \deprecated Use the constructor taking a convention and possibly a termination date. - Deprecated in version 1.23. - */ - QL_DEPRECATED - Thirty360() - : DayCounter(implementation(Thirty360::BondBasis, Date(), false)) {} - - /*! \deprecated Use the constructor taking a convention and possibly a termination date. - Deprecated in version 1.23. - */ - QL_DEPRECATED - Thirty360(Convention c, bool isLastPeriod) - : DayCounter(implementation(c, Date(), isLastPeriod)) {} - explicit Thirty360(Convention c, const Date& terminationDate = Date()) - : DayCounter(implementation(c, terminationDate, false)) {} + : DayCounter(implementation(c, terminationDate)) {} }; }