]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/libstdc++-v3/contrib/libstdc++-v3-4.1.0/docs/html/ext/pb_assoc/introduction.html
update
[l4.git] / l4 / pkg / libstdc++-v3 / contrib / libstdc++-v3-4.1.0 / docs / html / ext / pb_assoc / introduction.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <HTML>
3 <HEAD>
4 <TITLE>Introduction</TITLE>
5 <META NAME="Generator" content="Microsoft Visual Studio .NET 7.1">
6 <base target = "content">
7 </HEAD>
8 <BODY>
9 <H1>Introduction</H1>
10
11 <p>
12         There are (at least) three orthogonal challenges to designing generic associative containers:
13 </p>
14
15 <ol>
16         <li> The choice of underlying data-structure affects not only the performance of containers, but their semantics as well. <i>E.g.</i>, containers based on trees store elements by a given order, while containers based on hash tables store elements in a meaningless (and probably time-varying) order; containers based on node-based trees can guarantee exception-free element erasing, while containers based on vector-based trees cannot. This complicates generic manipulation of associative containers based on different underlying data-structures.
17         </li>
18         <li>
19                 Underlying data-structures can act very differently given different policies. <i>E.g.</i>, the policy by which a hash table translates a hash value into a position within a table affects performance dramatically; certain policies can make containers based on trees support order statistics (<i>i.e.</i>, queries on the order of stored elements) or other useful queries. This complicates the policy design of an associative container based on a given data-structure.
20         </li>
21         <li>
22         Various mapping semantics are appropriate in different settings. <i>E.g.</i>, in some cases a unique mapping between each key and a datum is appropriate (such as the STL's <tt>std::map</tt> guarantees); in other cases, unique storage of keys is required (such as the STL's <tt>std::set</tt> guarantees); in other cases, more complex mapping semantics are required. This complicates generic manipulation of associative containers with different mapping semantics.
23         </li>
24 </ol>
25
26 <p>
27         <tt>pb_assoc</tt> attempts to address these problems safely and efficiently.
28 </p>
29
30 </BODY>
31 </HTML>