Examples

  1. Basic use
  2. Generics
  3. Hash-Based Containers
  4. Tree-Based Containers

Basic Use

  1. basic_map.cc- Basic use of "maps".
  2. basic_set.cc- Basic use of "sets". See Mapping Semantics::Data Types as a Policy.
  3. basic_multimap.cc- Basic use of "multimaps". See Mapping Semantics::Data Types as a Policy.
  4. erase_if.cc- Conditionally erasing values from a container object. See Motivation::Choice of Methods.

Generics

  1. ds_traits.cc- Using ds_traits to query about underlying data-structure behaviour. See Data-Structure Genericity::Data-Structure Tags and Traits.
  2. mapping_level.cc- Rebinding a compound associative-container to different mapping levels. See Mapping-Semantics::Mapping Levels.
  3. ms_traits.cpp- Using ms_traits to query about mapping semantics. See Mapping-Semantics::Tags and Traits.
  4. cc_ht_extract_key.cc- Extracting the key from different types.

Hash-Based Containers

See Hash-Based Containers.

General

  1. hash_bad_find.cc- A non-compiling example showing wrong use of finding keys in hash-based containers. See Data-Structure Genericity::Find-Type and Range-Type Methods and Iterators.

Resize-Related

See Hash-Based Containers::Resize Policies.

  1. hash_initial_size.cc- Setting the initial size of a hash-based container object.
  2. hash_bad_resize.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-Related

See Hash-Based Containers::Hash Policies.

  1. hash_mod.cc- Using a modulo range-hashing function.
  2. store_hash.cc- Storing the hash value along with each key.
  3. shift_mask.cc- Writing a range-hashing functor.
  4. ranged_hash.cc- Writing a ranged-hash functor.

Tree-Based Containers

See Tree-Based Containers.

Node-Invariatns

See Tree-Based Containers::Node Invariants.

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

Split and Join

See Tree-Based Containers::Additional Types and Methods.

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