[Click] Perhaps trivial question
Eddie Kohler
kohler at cs.ucla.edu
Sun Nov 28 14:37:38 EST 2004
Hi Bart,
I think you might have an old version of Click. The current
Vector<T*>::erase() has an explicit cast, which should be enough. Can you
update to the current anonymous CVS and let us know if that helps?
Eddie
Bart Braem wrote:
> Hello,
>
> In my code I need to traverse a whole Hashmap, use the data inside each entry
> and then delete that entry. I tried using the erase method based on 1
> iterator (later also with 2 iterator arguments) but it doesn't compile: my
> iterator is incompatible with void**:
> ../include/click/vector.hh: In member function `T**
> Click::Vector<T*>::erase(T**) [with T = Click::Packet]':
> ../elements/aodv/aodv_waitingfordiscovery.cc:156: instantiated from here
> ../include/click/vector.hh:239: error: invalid conversion from `void**' to `
> Click::Packet**'
>
>
> How is that solved? I see other people use it and it works there. The
> difference is that in all available code erase is used on vector.begin() and
> vector.begin()+1. But those are iterators, right? If I use the following
> (pair->value.packets has type Vector<Packet*>) I get that compiler error:
>
> pair->value.packets.erase(pair->value.packets.begin());
>
> Any help is appreciated as currently I use the back() and pop_back() methods
> but that's not really safe.
>
> Thanks
> Bart
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
More information about the click
mailing list