Skip to content

Commit 9cbc035

Browse files
committed
Make variadic exercise with tuple less trivial
1 parent e7e6912 commit 9cbc035

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp11training/cpp11training/7.variadic_templates.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ TEST(variadic_tuple_iteration, DISABLED_we_can_transform_an_indexed_tuple) {
137137
// So we need a helper structure/accumulator/loop variable to keep track
138138
// of the element index we're looking at.
139139
//
140-
const auto input = std::make_tuple(1, 2, 3);
140+
const auto input = std::make_tuple(1, 2, 3.5);
141141
const auto f = [](auto i) { return i + 1; };
142142
const auto result = transform(f, input);
143143
EXPECT_EQ(2, std::get<0>(result));
144144
EXPECT_EQ(3, std::get<1>(result));
145-
EXPECT_EQ(4, std::get<2>(result));
145+
EXPECT_NEAR(4.5, std::get<2>(result), .0001);
146146
}
147147
auto product = [](auto... functions)
148148
{

0 commit comments

Comments
 (0)