Personal Home
Personal Home
About
🛒

C++ 排序的一个坑

C++ named requirements: Compare
Compare is a set of requirements expected by some of the standard library facilities from the user-provided function object types. The return value of the function call operation applied to an object of a type satisfying Compare, when contextually converted to , yields if the first argument of the call appears before the second in the strict weak ordering relation induced by this type, and otherwise.
C++ named requirements: Compare
https://en.cppreference.com/w/cpp/named_req/Compare
notion image
调用 std::sort 函数时,comare函数的要求:
comp(a,a) == false
 
Copyright 2022 pipecat