#include #include std::set data; int main(int argc, char** argv) { for (int i = 0 ; i < 500 ; i+=5) { data.insert(i); } std::set::iterator iter = data.lower_bound(33); std::cout << "expect 35" << std::endl; std::cout << "lower_bound 33 found: " << *iter << std::endl; iter = data.lower_bound(50); std::cout << "expect 50" << std::endl; std::cout << "lower_bound 50 found: " << *iter << std::endl; iter = data.upper_bound(33); std::cout << "expect 35" << std::endl; std::cout << "upper_bound 33 found: " << *iter << std::endl; iter = data.upper_bound(50); std::cout << "expect 55" << std::endl; std::cout << "upper_bound 50 found: " << *iter << std::endl; return 0; }