Commit 6215a88d authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot 2

Fix Build: sorted_vector_types.h on GCC v4.8

Summary:
[Folly] Fix Build: `sorted_vector_types.h` on GCC v4.8.

Problem: that compiler does not yet support `auto`-typed lambda parameters.

Solution: specify the types of the lambda parameters.

Reviewed By: mzlee, Orvid

Differential Revision: D3551262

fbshipit-source-id: 160d3245ec422060175ce59ee653d158954477ed
parent 82142aa3
......@@ -573,25 +573,33 @@ public:
iterator lower_bound(const key_type& key) {
auto c = key_comp();
auto f = [&](const auto& a, const auto& b) { return c(a.first, b); };
auto f = [&](const value_type& a, const key_type& b) {
return c(a.first, b);
};
return std::lower_bound(begin(), end(), key, f);
}
const_iterator lower_bound(const key_type& key) const {
auto c = key_comp();
auto f = [&](const auto& a, const auto& b) { return c(a.first, b); };
auto f = [&](const value_type& a, const key_type& b) {
return c(a.first, b);
};
return std::lower_bound(begin(), end(), key, f);
}
iterator upper_bound(const key_type& key) {
auto c = key_comp();
auto f = [&](const auto& a, const auto& b) { return c(a, b.first); };
auto f = [&](const key_type& a, const value_type& b) {
return c(a, b.first);
};
return std::upper_bound(begin(), end(), key, f);
}
const_iterator upper_bound(const key_type& key) const {
auto c = key_comp();
auto f = [&](const auto& a, const auto& b) { return c(a, b.first); };
auto f = [&](const key_type& a, const value_type& b) {
return c(a, b.first);
};
return std::upper_bound(begin(), end(), key, f);
}
......@@ -601,7 +609,9 @@ public:
// have to do this.
iterator low = lower_bound(key);
auto c = key_comp();
auto f = [&](const auto& a, const auto& b) { return c(a, b.first); };
auto f = [&](const key_type& a, const value_type& b) {
return c(a, b.first);
};
iterator high = std::upper_bound(low, end(), key, f);
return std::make_pair(low, high);
}
......
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