Commit 5c57c80c authored by Joe Loser's avatar Joe Loser Committed by Facebook Github Bot

Remove GCC 4.9 workaround in FunctionTest (#1126)

Summary:
- On GCC 4.9 and below, the type of `vec` could not be deduced in the
  `for_each` call.
- Since folly requires GCC 5.1 or later now, which has no issues in the
  deduction, remove the workaround and associated comment.
Pull Request resolved: https://github.com/facebook/folly/pull/1126

Reviewed By: Orvid

Differential Revision: D15292875

Pulled By: yfeldblum

fbshipit-source-id: 50533536e9e73d2c3e5d466d1b6143d0d4085648
parent 4e928185
......@@ -811,11 +811,7 @@ TEST(Function, SafeCaptureByReference) {
// for_each's second parameter is of type Function<...> const&.
// Hence we know we can safely pass it a lambda that references local
// variables. There is no way the reference to x will be stored anywhere.
for_each<std::vector<int>>(vec, [&sum](int x) { sum += x; });
// gcc versions before 4.9 cannot deduce the type T in the above call
// to for_each. Modern compiler versions can compile the following line:
// for_each(vec, [&sum](int x) { sum += x; });
for_each(vec, [&sum](int x) { sum += x; });
EXPECT_EQ(999, sum);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment