std::vector<int> arr{1, -1, 1, 1, 1, 4, -1, 4, 4, 4, -1, 7, 8, -1};
auto begin = boost::make_filter_iterator<is_positive_number>(arr.begin(), arr.end());
auto end = boost::make_filter_iterator<is_positive_number>(arr.end(), arr.end());
auto lower = std::lower_bound(arr.begin(), arr.end(), i, [](const auto& val1, const auto& val2) {
return val1 < val2;
});
std::vector<int>::iterator iter = ??????(lower);
可能
std::lower_bound有必要转移begin和end,否则它们不会被使用。你可以通过lower.base().