Skip to content

Commit 6b5065a

Browse files
victimsninokirkshoop
authored andcommitted
Fix compilation on c++11. Auto&& not needed here
1 parent 366ff2a commit 6b5065a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Rx/v2/test/operators/map.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,16 @@ SCENARIO("map doesn't provide copies", "[map][operators][copies]")
246246
auto empty_on_next = [](copy_verifier) {};
247247
auto sub = rx::make_observer<copy_verifier>(empty_on_next);
248248
copy_verifier verifier{};
249-
auto obs = verifier.get_observable().map([](auto&& v) { return std::forward<decltype(v)>(v); });
249+
auto obs = verifier.get_observable().map([](copy_verifier v) { return v; });
250250
WHEN("subscribe")
251251
{
252252
obs.subscribe(sub);
253253
THEN("no extra copies")
254254
{
255-
// 1 copy from map lambda
255+
// 1 copy to map lambda
256256
REQUIRE(verifier.get_copy_count() == 1);
257-
// 1 move to final lambda
258-
REQUIRE(verifier.get_move_count() == 1);
257+
// 1 move from map lambda + 1 move to final lambda
258+
REQUIRE(verifier.get_move_count() == 2);
259259
}
260260
}
261261
}
@@ -269,15 +269,15 @@ SCENARIO("map doesn't provide copies for move", "[map][operators][copies]")
269269
auto empty_on_next = [](copy_verifier) {};
270270
auto sub = rx::make_observer<copy_verifier>(empty_on_next);
271271
copy_verifier verifier{};
272-
auto obs = verifier.get_observable_for_move().map([](auto&& v) { return std::forward<decltype(v)>(v); });
272+
auto obs = verifier.get_observable_for_move().map([](copy_verifier v) { return v; });
273273
WHEN("subscribe")
274274
{
275275
obs.subscribe(sub);
276276
THEN("no extra copies")
277277
{
278278
REQUIRE(verifier.get_copy_count() == 0);
279-
// 1 move from map lambda + 1 move to final lambda
280-
REQUIRE(verifier.get_move_count() == 2);
279+
// 1 move to map lambda + 1 move from map lambda + 1 move to final lambda
280+
REQUIRE(verifier.get_move_count() == 3);
281281
}
282282
}
283283
}

0 commit comments

Comments
 (0)