C++:Reference to non-static member function must be called

记录踩坑:

​ 做LeetCode每日一题1356. 根据数字二进制下 1 的数目排序时,遇到的坑。题目很简单,利用lowbit操作计算一个数二进制1的个数,接着自定义比较函数进行排序即可,但是C++在类中自定义比较函数不能简单地定义为成员函数,需要定义为静态成员函数。

​ 具体看:Reference to non-static member function must be called

posted @ 2020-11-06 10:33  macguz  阅读(3064)  评论(0编辑  收藏  举报