[Click] hastable/HashMap

Eddie Kohler kohler at cs.ucla.edu
Fri Oct 5 12:20:43 EDT 2007


Hi Marco,

We needed to provide a template<class T> hashcode(T *) specialization, which 
we had not done.  Now we do.

Eddie


Marco Wenzel wrote:
> Hi,
> 
> since I updated Click to the current git-sources (last version was from
> 2007-07-10), I've got a problem with the usage of HashTable.
> The code
> 
>> dsttable->remove(packet);
> 
> where dsttable is
> 
>> typedef HashMap<Packet*, IPAddress*> DstMap;
>> DstMap* dsttable;
> 
> and packet is a
> 
>> WritablePacket * packet;
> 
> causes thefollowing compile-error:
> 
> ../include/click/hashcode.hh: In function 'size_t hashcode(const T&) [with T =
> Packet*]':
> ../include/click/hashmap.cc:510:   instantiated from 'size_t HashMap<K,
> void*>::bucket(const K&) const [with K = Packet*]'
> ../include/click/hashmap.cc:609:   instantiated from 'bool HashMap<K,
> void*>::remove(const K&) [with K = Packet*]'
> ../elements/local/myelement.cc:49:   instantiated from here
> ../include/click/hashcode.hh:9: error: request for member 'hashcode' in 'x',
> which is of non-class type 'Packet* const'
> 
> It worked correctly before and I don't know how to interpret this error. Sorry,
> if this question is too trivial, but if anyone could help me, I would be very
> glad. Thanks a lot.
> 
> Regards,
> Marco.
> 
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list