Previous Thread  Next Thread

chat icon Gen_Map.h problem

mmwilde

Posted: Sat Nov 23, 2002 6:38 am
Joined: 04 Nov 2002
Posts: 1
Here is the code snippit from Gen_Map.h that I can't get to compile under MSVC6:

void insert(const Key& key, const Value& value) {
Entry *entry_ptr = m_buckets[key.hash() % m_num_buckets];
while ((entry_ptr != 0) && !(key == entry_ptr->m_key)) {
entry_ptr = entry_ptr->m_next;
}

if (entry_ptr != 0) {
entry_ptr->m_value = value;
}
else {
Entry **bucket = &m_buckets[key.hash() % m_num_buckets];
*bucket = new Entry(*bucket, key, value);
}

Error is:GEN_Map.h(109) : error C2678: binary '==' : no operator defined which takes a left-hand operand of type
'const class GEN_HashedPtr' (or there is no acceptable conversion)


I can't seem to find the problem.

Thanks in advance....Mike
Reply with quote


benoit

Posted: Mon Nov 25, 2002 2:07 pm
Joined: 16 Oct 2002
Posts: 5
It's probably a bug in MS compiler. Install Visual C++ sp4 and it will compile fine.

Benoit.
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group