Associative-Container Examples

Basic Use

  1. basic_map.cc Basic use of "maps".
  2. basic_set.cc Basic use of "sets".
  3. erase_if.cc Conditionally erasing values from a container object.

Generics

  1. assoc_container_traits.cc Using container_traits to query about underlying data structure behavior.
  2. hash_find_neg.cc A non-compiling example showing wrong use of finding keys in hash-based containers.

Hash-Based Containers

Resize Related

  1. hash_initial_size.cc Setting the initial size of a hash-based container object.
  2. hash_resize_neg.cc A non-compiling example showing how not to resize a hash-based container object.
  3. hash_resize.cc Resizing the size of a hash-based container object.
  4. hash_illegal_resize.cc Showing an illegal resize of a hash-based container object.
  5. hash_load_set_change.cc Changing the load factors of a hash-based container object.

Hash-Function Related

  1. hash_mod.cc Using a modulo range-hashing function for the case of an unknown skewed key distribution.
  2. shift_mask.cc Writing a range-hashing functor for the case of a known skewed key distribution.
  3. store_hash.cc Storing the hash value along with each key.
  4. ranged_hash.cc Writing a ranged-hash functor.

Tree-Like Containers (Trees and Tries)

Node-Invariants

  1. tree_order_statistics.cc Using trees for order statistics.
  2. tree_intervals.cc Augmenting trees to support operations on line intervals.

Split and Join

  1. tree_join.cc Joining two tree-based container objects.
  2. trie_split.cc Splitting a PATRICIA trie container object.
  3. tree_order_statistics_join.cc Order statistics while joining two tree-based container objects.

Trie-Based Containers

  1. trie_dna.cc Using a PATRICIA trie for DNA strings.
  2. trie_prefix_search.cc Using a PATRICIA trie for finding all entries whose key matches a given prefix.

"Multimaps" and "Multisets".

  1. basic_multimap.cc Basic use of "multimaps".
  2. basic_multiset.cc Basic use of "multisets".