-2

OLSR クラスファイル
OLSR.cc

OLSR::link_sensing
(OLSR_msg& msg, const nsaddr_t &receiver_iface, const nsaddr_t &sender_iface, const int &index)

{
OLSR_hello& hello = msg.hello();
double now = CURRENT_TIME;
bool updated = false;
bool created = false;

OLSR_link_tuple* link_tuple = state_.find_link_tuple(sender_iface);
if (link_tuple == NULL)
{
    // We have to create a new tuple
    link_tuple = new OLSR_link_tuple;
    link_tuple->nb_iface_addr() = sender_iface;
    link_tuple->local_iface_addr() = receiver_iface;

    //For testing only
    if(sender_iface == 168427530 && receiver_iface == 169082900 ) //Error occur at this line
    {
        link_tuple->link_quality_metric() = 0.9;
    }

OLSR ヘッダー ファイル OLSR.h

virtual bool        link_sensing(OLSR_msg&, const nsaddr_t &, const nsaddr_t &, const int &);

error get: Description
no match for 'operator==' in 'receiver_iface == 169082900'

4

1 に答える 1

0

エラーメッセージは明確です。

「receiver_iface == 169082900」の「operator==」に一致しません

==つまり、コンパイラはin の意味を理解していません

receiver_iface == 169082900

receiver_ifaceつまり、とを比較する方法がわかりません169082900

receiver_ifaceはタイプnsaddr_t(それが何であれ) で169082900あり、タイプはintです。

したがって、エラーの原因となるコードの前に次の関数を定義する必要があります。

bool operator== (const nsaddr_t &left, int right)
{
    // whatever you consider appropriate
}
于 2013-05-29T03:52:57.307 に答える