NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Priority Deques

This module implements a priority deque adaptor, allowing to push/pop from both ends of the container:

Example

// build a simple priority_deque over 4 integers
typedef vector_view<uint32*> vector_type;
typedef priority_deque<uint32, vector_type> deque_type;
uint32 deque_storage[4] = { 5, 3, 8, 1 }
// construct the deque
deque_type deque( vector_type( 4u, deque_storage ) );
// pop from both ends
printf( "%u\n", deque.top() ); // -> 8
deque.pop_top();
printf( "%u\n", deque.bottom() ); // -> 1
deque.pop_bottom();
printf( "%u\n", deque.top() ); // -> 5
deque.pop_top();
// perhaps push one more item
deque.push( 7 );
// and keep popping
printf( "%u\n", deque.bottom() ); // -> 3
deque.pop_bottom();
printf( "%u\n", deque.bottom() ); // -> 7
deque.pop_bottom();