<div dir="ltr"><div>I am finding difficult to understand your answer, but I try to address the following question:</div><div><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"> >> <i>What criteria should I use to choose a specific Boost.Heap implementation from the ones provided by the Boost.Heap library?</i></span><br style="font-size:12.8px"></div><div><br></div><div>Boost.Heap's data structures are documented here: </div><div> <a href="http://www.boost.org/doc/libs/1_61_0/doc/html/heap/data_structures.html">http://www.boost.org/doc/libs/1_61_0/doc/html/heap/data_structures.html</a> </div><div><br></div><div>There is a simple table which shows the complexity for every public function you may use. Just go through those functions and look for the ones your are going to use the most and then choose the ones with less complexity.</div><div><br></div><div>In most cases <b>fibonacci_heap</b> will be the best option... When in doubt, just go for fibonacci_heap. </div><div><br></div><div>Best regards</div><div>Juan</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 27, 2016 at 11:20 AM, degski <span dir="ltr"><<a href="mailto:degski@gmail.com" target="_blank">degski@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On 25 September 2016 at 17:07, degski <span dir="ltr"><<a href="mailto:degski@gmail.com" target="_blank">degski@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div dir="ltr">What criteria should I use to choose a specific Boost.Heap implementation (skew, fibonacci etc), from the ones provided by the Boost.Heap library?</div></div></div></blockquote><div><br></div></span><div> Well, as no answer, wrote my own:<br><br>#define BV_NOEXCEPT noexcept<br>#define BV_CONST_NOEXCEPT const noexcept<br><br>template < typename T ><br>class priority_queue {<br><br>private:<br><br> typedef std::vector < T > Data;<br><br>public:<br><br> typedef typename Data::iterator iterator;<br> typedef typename Data::const_iterator const_iterator;<br><br>private:<br><br> Data m_data;<br><br>public:<br><br> priority_queue ( ) BV_NOEXCEPT {<br><br> m_data.reserve ( 16 );<br> }<br><br> iterator begin ( ) BV_NOEXCEPT {<br><br> return m_data.begin ( );<br> }<br><br> const_iterator begin ( ) BV_CONST_NOEXCEPT {<br><br> return m_data.begin ( );<br> }<br><br> iterator end ( ) BV_NOEXCEPT {<br><br> return m_data.end ( );<br> }<br><br> const_iterator end ( ) BV_CONST_NOEXCEPT {<br><br> return m_data.end ( );<br> }<br><br> void push ( const T & t_ ) BV_NOEXCEPT {<br><br> const const_iterator i = std::lower_bound ( m_data.begin ( ), m_data.end ( ), t_, std::greater < T > ( ) );<br><br> if ( i == m_data.end ( ) or std::greater < T > ( ) ( t_, * i ) ) {<br><br> m_data.insert ( i, t_ );<br> }<br> }<br><br> inline void pop ( ) BV_NOEXCEPT {<br><br> if ( m_data.size ( ) ) {<br><br> m_data.pop_back ( );<br> }<br> }<br><br> inline T top ( ) BV_CONST_NOEXCEPT {<br><br> return m_data.back ( );<br> }<br><br> inline size_t size ( ) BV_CONST_NOEXCEPT {<br><br> return m_data.size ( );<br> }<br><br> inline bool empty ( ) BV_CONST_NOEXCEPT {<br><br> return m_data.empty ( );<br> }<br>};<br><br></div><div>Have a good day,<br><br></div><div>degski<br></div><div><br></div></div> </div></div> <br>______________________________<wbr>_________________<br> Boost-users mailing list<br> <a href="mailto:Boost-users@lists.boost.org">Boost-users@lists.boost.org</a><br> <a href="http://lists.boost.org/mailman/listinfo.cgi/boost-users" rel="noreferrer" target="_blank">http://lists.boost.org/<wbr>mailman/listinfo.cgi/boost-<wbr>users</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Juan</div><div>:wq</div><div><br></div></div></div> </div>