J
John
I want to store an array of pointers (void *) to
iterators inside a map. The idea is to reach the
map <key,info> pair faster if the data is in the
array. If not use a O(log) search.
But stl wont let me typecast a map iterator to a void *
and store it in an array. Can this be done. I was looking
at the code of stl_tree and it seems that the "value" =
key,info pair is stored in a node and never moved unless
deleted. So if map points using an iterator to this value,
and I could store this iterator as a void * in an array,
I could do what I wanted.
The problem is that this array needs to have pointers
to many different maps and hence I want it to be void *.
Any ideas on how this could be done?
Thanks,
--j
iterators inside a map. The idea is to reach the
map <key,info> pair faster if the data is in the
array. If not use a O(log) search.
But stl wont let me typecast a map iterator to a void *
and store it in an array. Can this be done. I was looking
at the code of stl_tree and it seems that the "value" =
key,info pair is stored in a node and never moved unless
deleted. So if map points using an iterator to this value,
and I could store this iterator as a void * in an array,
I could do what I wanted.
The problem is that this array needs to have pointers
to many different maps and hence I want it to be void *.
Any ideas on how this could be done?
Thanks,
--j