Skip to content

Commit

Permalink
Avoid deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Sep 20, 2024
1 parent 0c04b23 commit d4491a0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions ql/utilities/steppingiterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ namespace QuantLib {
explicit step_iterator(const Iterator& base, Size step)
: base_(base), step_(static_cast<BigInteger>(step)) {}

step_iterator(const step_iterator& other)
: base_(other.base_), step_(other.step_) {}

template <class OtherIterator>
step_iterator(const step_iterator<OtherIterator>& i,
std::enable_if_t<std::is_convertible_v
Expand Down
10 changes: 5 additions & 5 deletions test-suite/inflation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1100,9 +1100,8 @@ BOOST_AUTO_TEST_CASE(testYYTermStructure) {
};

RelinkableHandle<YoYInflationTermStructure> hy;
bool interp = false;
auto rpi = ext::make_shared<UKRPI>();
auto iir = ext::make_shared<YoYInflationIndex>(rpi, interp, hy);
auto iir = ext::make_shared<YoYInflationIndex>(rpi, hy);
for (Size i=0; i<LENGTH(fixData); i++) {
rpi->addFixing(rpiSchedule[i], fixData[i]);
}
Expand Down Expand Up @@ -1257,9 +1256,8 @@ BOOST_AUTO_TEST_CASE(testYYTermStructureWithLag) {
207.3 };

RelinkableHandle<YoYInflationTermStructure> hy;
bool interp = false;
auto rpi = ext::make_shared<UKRPI>();
auto iir = ext::make_shared<YoYInflationIndex>(rpi, interp, hy);
auto iir = ext::make_shared<YoYInflationIndex>(rpi, hy);
for (Size i=0; i<LENGTH(fixData); i++) {
rpi->addFixing(rpiSchedule[i], fixData[i]);
}
Expand Down Expand Up @@ -1568,8 +1566,10 @@ BOOST_AUTO_TEST_CASE(testCpiYoYQuotedFlatInterpolation) {

Settings::instance().evaluationDate() = Date(10, February, 2022);

auto testIndex1 = ext::make_shared<YYUKRPI>(false);
auto testIndex1 = ext::make_shared<YYUKRPI>();
QL_DEPRECATED_DISABLE_WARNING
auto testIndex2 = ext::make_shared<YYUKRPI>(true);
QL_DEPRECATED_ENABLE_WARNING

testIndex1->addFixing(Date(1, November, 2020), 0.02935);
testIndex1->addFixing(Date(1, December, 2020), 0.02954);
Expand Down
3 changes: 1 addition & 2 deletions test-suite/inflationcapfloor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ struct CommonVars {
rpi->addFixing(rpiSchedule[i], fixData[i]);
}
// link from yoy index to yoy TS
bool interp = false;
iir = ext::make_shared<YoYInflationIndex>(rpi, interp, hy);
iir = ext::make_shared<YoYInflationIndex>(rpi, hy);

ext::shared_ptr<YieldTermStructure> nominalFF(
new FlatForward(evaluationDate, 0.05, ActualActual(ActualActual::ISDA)));
Expand Down
3 changes: 1 addition & 2 deletions test-suite/inflationcapflooredcoupon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ struct CommonVars {
rpi->addFixing(rpiSchedule[i], fixData[i]);
}
// link from yoy index to yoy TS
bool interp = false;
iir = ext::make_shared<YoYInflationIndex>(rpi, interp, hy);
iir = ext::make_shared<YoYInflationIndex>(rpi, hy);

ext::shared_ptr<YieldTermStructure> nominalFF(
new FlatForward(evaluationDate, 0.05, ActualActual(ActualActual::ISDA)));
Expand Down
2 changes: 2 additions & 0 deletions test-suite/inflationvolatility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ void setup() {
Date eval = Date(Day(23), Month(11), Year(2007));
Settings::instance().evaluationDate() = eval;

QL_DEPRECATED_DISABLE_WARNING
yoyIndexUK = ext::make_shared<YoYInflationIndex>(ext::make_shared<UKRPI>(), true, yoyUK);
yoyIndexEU = ext::make_shared<YoYInflationIndex>(ext::make_shared<EUHICP>(), true, yoyEU);
QL_DEPRECATED_ENABLE_WARNING

// nominal yield curve (interpolated; times assume year parts have 365 days)
Real timesEUR[] = {0.0109589, 0.0684932, 0.263014, 0.317808, 0.567123, 0.816438,
Expand Down

0 comments on commit d4491a0

Please sign in to comment.