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
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);
}
}