Skip to content

Commit

Permalink
More deprecated warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Oct 15, 2024
1 parent 69e2269 commit 2a8e5e4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ql/cashflows/subperiodcoupon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ namespace QuantLib {
}


QL_DEPRECATED_DISABLE_WARNING

SubPeriodsLeg::SubPeriodsLeg(Schedule schedule, ext::shared_ptr<IborIndex> i)
: schedule_(std::move(schedule)), index_(std::move(i)), paymentCalendar_(schedule_.calendar()) {
QL_REQUIRE(index_, "no index provided");
Expand Down Expand Up @@ -474,14 +476,12 @@ namespace QuantLib {
paymentDate, -exCouponPeriod_, exCouponAdjustment_, exCouponEndOfMonth_);
}
}
QL_DEPRECATED_DISABLE_WARNING
cashflows.push_back(ext::shared_ptr<CashFlow>(new SubPeriodsCoupon(
paymentDate, detail::get(notionals_, i, notionals_.back()), start, end,
detail::get(fixingDays_, i, index_->fixingDays()), index_,
detail::get(gearings_, i, 1.0), detail::get(couponSpreads_, i, 0.0),
detail::get(rateSpreads_, i, 0.0), refStart, refEnd, paymentDayCounter_,
exCouponDate)));
QL_DEPRECATED_ENABLE_WARNING
}

switch (averagingMethod_) {
Expand All @@ -499,4 +499,6 @@ namespace QuantLib {
return cashflows;
}

QL_DEPRECATED_ENABLE_WARNING

}
10 changes: 9 additions & 1 deletion ql/instruments/zerocouponswap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ namespace QuantLib {
const Date& maturityDate,
Real nominal,
const ext::shared_ptr<IborIndex>& index) {
Schedule schedule = MakeSchedule()
.from(startDate)
.to(maturityDate)
.withTenor(index->tenor())
.withCalendar(index->fixingCalendar())
.withConvention(index->businessDayConvention())
.backwards()
.endOfMonth(index->endOfMonth());
auto floatCpn = ext::make_shared<SubPeriodsCoupon>(
paymentDate, nominal, startDate, maturityDate, index->fixingDays(), index);
paymentDate, nominal, schedule, index->fixingDays(), index);
floatCpn->setPricer(
ext::shared_ptr<FloatingRateCouponPricer>(new CompoundingRatePricer));
return floatCpn;
Expand Down

0 comments on commit 2a8e5e4

Please sign in to comment.