Commit 44365277 authored by Peter Griess's avatar Peter Griess

Cast lambda to function pointer for boost::split().

Summary:
- For some reason, Boost's internals aren't considering this lambda a
type that's castable. Cast it to a function pointer before using it.

Test Plan:
- fbconfig -r folly && fbmake runtests
- ./configure && make check on Ubuntu/FC/Mac
- _bin/folly/test/string_test --benchmark

Reviewed By: alandau@fb.com

FB internal diff: D998594
parent 69b46104
......@@ -965,9 +965,10 @@ BENCHMARK(splitStrFixed, iters) {
BENCHMARK(boost_splitOnSingleChar, iters) {
static const std::string line = "one:two:three:four";
bool(*pred)(char) = [] (char c) -> bool { return c == ':'; };
for (int i = 0; i < iters << 4; ++i) {
std::vector<boost::iterator_range<std::string::const_iterator> > pieces;
boost::split(pieces, line, [] (char c) { return c == ':'; });
boost::split(pieces, line, pred);
}
}
......
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