c++ - How do I get elements from boost::fibonacci_heap by handle? -


i using boost::fibonacci_heap class boost 1.53.0 maintain updateable priority queue.

when want update element need compare element in heap new element want replace with. want replace elements in heap "smaller" versions want compare them before update.

when insert elements store handle (boost::fibonacci_heap::handle_type). functions have seen in documentation fibonacci_heap take handle type provide sort of write access (update(), decrease(), increase() etc.) , don't allow me inspect element identified handle before update it.

is there way @ element in fibonacci_heap using handle only?

you should able dereference handle. example of provided here: http://www.boost.org/doc/libs/1_50_0/doc/html/heap/concepts.html

example site

fibonacci_heap<heap_data> heap; heap_data f; fibonacci_heap<heap_data>::handle_type handle = heap.push(f); (*handle).handle = handle; // store handle in node 

so call

(*handle) 

to reference class stored in heap.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -