错误C2064:术语不评估为采用2个参数的函数

时间:2015-02-05 13:16:21

标签: c++

我在cpp文件中有投票方法,如下面的方法:

void CMOReplicationlayer::Voting(std::list<CMOData*>* pa_repQueue, CMOData* pa_votedData)
    { 
        pa_repQueue->sort(&CMOReplicationlayer::compare_d);
        pa_votedData = pa_repQueue->front();
    }

我在头文件中有CMOData struct,如下所示:

struct CMOData
        {
            TForteByte* pa_pvData = NULL;//Received data serialization byte
            unsigned int pa_unSize = 0;//The size after adding Date & Time
            CIEC_TIME* pa_Offset = NULL;//Offset Value
            TForteUInt64 pa_recvDateTime = NULL;

            bool operator()(CMOData first, CMOData second)
            {
                bool result = false;
                if (first.pa_recvDateTime == second.pa_recvDateTime)
                    result = true;
                return result;
            }
        };

compare method是这样的:

bool compare_a(const CMOReplicationlayer::CMOData& first, const CMOReplicationlayer::CMOData& second)
        {
            return first.pa_recvDateTime < second.pa_recvDateTime;
        }

        bool compare_d(const CMOReplicationlayer::CMOData& first, const CMOReplicationlayer::CMOData& second)
        {
            return first.pa_recvDateTime > second.pa_recvDateTime;
        }

但我在cpp文件中没有t know why I get this error when I want to use排序列表方法。

"error C2064: term does not evaluate to a function taking 2 arguments"

0 个答案:

没有答案