Skip to content

Commit 0305de0

Browse files
committed
Avoid weird error on 32-bit VC++2015
1 parent df7eeb4 commit 0305de0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

test-suite/inflation.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ void InflationTest::testCpiLinearInterpolation() {
11231123
testIndex1->addFixing(Date(1, February, 2021), 296.0);
11241124
testIndex1->addFixing(Date(1, March, 2021), 296.9);
11251125

1126-
for (const auto& testIndex : {testIndex1, testIndex2}) {
1126+
auto check = [&](const ext::shared_ptr<ZeroInflationIndex>& testIndex) {
11271127
Real calculated = CPI::laggedFixing(testIndex, Date(10, February, 2021), 3 * Months, CPI::Linear);
11281128
Real expected = 293.5 * (19/28.0) + 295.4 * (9/28.0);
11291129

@@ -1153,7 +1153,10 @@ void InflationTest::testCpiLinearInterpolation() {
11531153
"failed to retrieve inflation fixing" <<
11541154
"\n expected: " << expected <<
11551155
"\n calculated: " << calculated);
1156-
}
1156+
};
1157+
1158+
check(testIndex1);
1159+
check(testIndex2);
11571160
}
11581161

11591162
void InflationTest::testCpiAsIndexInterpolation() {

0 commit comments

Comments
 (0)