【发布时间】:2020-03-23 11:05:48
【问题描述】:
我正在尝试通过它们的极角 w.r.t 对平面上的点进行排序。 O点。代码的简化版如下所示:
bool comparePolar(point A, point B, point O){
//if point B lies to the left of the edge OA, return false
//return true
}
那么,如何在调用排序函数时将点O传递给这个函数,它将使用comparePolar作为它的比较函数?
【问题讨论】:
标签: c++ sorting parameter-passing custom-compare