Logo Search packages:      
Sourcecode: pan version File versions  Download package

pan::sorted_vector< K, bNoDuplicates, Pr, A > Class Template Reference

#include <sorted-vector.h>

List of all members.

Detailed Description

template<class K, bool bNoDuplicates = false, class Pr = std::less<K>, class A = std::allocator<K>>
class pan::sorted_vector< K, bNoDuplicates, Pr, A >

std::set implemented as a sorted vector.

This can give a significant memory improvement over std::set, which is implemented as a tree. The tradeoff is that insertion and removal is slow, so this is best used on sets whose contents rarely change.

This class was written by Martin Holzherr and is in the public domain.

Definition at line 44 of file sorted-vector.h.

Public Types

typedef Cont::allocator_type allocator_type
typedef Cont::const_iterator const_iterator
typedef Cont::const_reference const_reference
typedef std::vector< K, A > Cont
typedef Cont::difference_type difference_type
typedef Cont::iterator iterator
typedef Pr key_compare
typedef K key_type
typedef sorted_vector< K,
bNoDuplicates, Pr, A > 
typedef std::pair
< const_iterator,
const_iterator > 
typedef std::pair< iterator, bool > Pairib_
typedef std::pair< iterator,
iterator > 
typedef Cont::reference reference
typedef Cont::reverse_iterator reverse_iterator
typedef Cont::size_type size_type
typedef Pr value_compare
typedef Cont::value_type value_type

Public Member Functions

void assign (size_type n, const K &x=K())
void assign (const_iterator first, const_iterator beyond)
reference at (size_type p)
const_reference at (size_type p) const
const_reference back () const
reference back ()
const_iterator begin () const
iterator begin ()
void clear ()
size_type count (const K &k) const
bool empty () const
const_iterator end () const
iterator end ()
bool Eq_ (const Myt_ &x) const
template<class KeyType>
Paircc_ equal_range (const KeyType &k) const
template<class KeyType>
Pairii_ equal_range (const KeyType &k)
size_type erase (const K &key)
iterator erase (iterator first, iterator beyond)
iterator erase (iterator p)
template<class KeyType>
const_iterator find (const KeyType &k) const
template<class KeyType>
iterator find (const KeyType &k)
const_reference front () const
reference front ()
get_allocator () const
Cont & get_container ()
template<class It>
void insert (It first, It beyond)
iterator insert (iterator it, const value_type &x)
Pairib_ insert (const value_type &x)
key_compare key_comp () const
template<class KeyType>
const_iterator lower_bound (const KeyType &k) const
template<class KeyType>
iterator lower_bound (const KeyType &k)
bool Lt_ (const Myt_ &x) const
size_type max_size () const
Myt_operator= (const Cont &x)
Myt_operator= (const Myt_ &x)
reference operator[] (size_type p)
const_reference operator[] (size_type p) const
void pop_back ()
const_reverse_iterator rbegin () const
reverse_iterator rbegin ()
const_reverse_iterator rend () const
reverse_iterator rend ()
void reserve (size_type n)
size_type size () const
void sort ()
 sorted_vector (const Myt_ &x)
template<class It>
 sorted_vector (It first, It beyond, const Pr &pred=Pr(), const A &al=A())
 sorted_vector (const Pr &pred=Pr(), const A &al=A())
void stable_sort ()
void swap (Myt_ &x)
template<class KeyType>
const_iterator upper_bound (const KeyType &k) const
template<class KeyType>
iterator upper_bound (const KeyType &k)
value_compare value_comp () const

Protected Member Functions

iterator InsertImpl_ (iterator p, const value_type &x)
bool KeyCompare_Geq_ (const K &ty0, const K &ty1)
bool KeyCompare_Gt_ (const K &ty0, const K &ty1)
bool KeyCompare_Leq_ (const K &ty0, const K &ty1)
iterator Unique_ ()

Protected Attributes

key_compare key_compare_
Cont vec_


void swap (Myt_ &x, Myt_ &Y_)

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index