C++ std::lower_bound和std::upper_bound之间有什么区别?

C++ std::lower_bound和std::upper_bound之间有什么区别?,c++,C++,以下代码不能同时使用MSVC2017和GCC11编译: #include <deque> #include <chrono> #include <algorithm> using Clock = std::chrono::system_clock; using TimePoint = std::chrono::time_point<Clock>; struct PricePoint { TimePoint dt; double

以下代码不能同时使用MSVC2017和GCC11编译:

#include <deque>
#include <chrono>
#include <algorithm>

using Clock = std::chrono::system_clock;
using TimePoint = std::chrono::time_point<Clock>;

struct PricePoint
{
    TimePoint dt;
    double buy;
    double sell;
};

inline bool operator < (const TimePoint & dt, const PricePoint & a)
{
    return a.dt < dt;
}

int main()
{
    std::deque<PricePoint> priceSequence;
    const auto begin = std::lower_bound(priceSequence.begin(), priceSequence.end(), Clock::now());
    return 0;
}
#包括
#包括
#包括
使用时钟=标准::时钟::系统时钟;
使用TimePoint=std::chrono::time\u point;
结构价格点
{
时间点dt;
双重购买;
双重销售;
};
内联布尔运算符<(常数时间点和dt、常数价格点和a)
{
返回a.dt
但是如果我用
std::upper\u-bound
替换
std::lower\u-bound
,它将开始编译。有什么区别

错误:与“运算符”不匹配
inline bool operator < (const PricePoint & a, const TimePoint & dt)
{
    return dt < a.dt;
}