fixed a bug of C++ lower bound function