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

    1 answer 1

    Probably in std::lower_bound it was necessary to pass begin and end , otherwise they are not used. And you can get the source iterator through lower.base() .