*: Regenerate.
[gcc.git] / libstdc++-v3 / doc / html / manual / ext_containers.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 23. HP/SGI Extensions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><meta name="keywords" content="
2 ISO C++
3 ,
4 library
5 "><meta name="keywords" content="
6 ISO C++
7 ,
8 runtime
9 ,
10 library
11 "><link rel="home" href="../index.html" title="The GNU C++ Library"><link rel="up" href="extensions.html" title="Part III.  Extensions"><link rel="prev" href="policy_data_structures_biblio.html" title="Acknowledgments"><link rel="next" href="bk01pt03ch23s02.html" title="Deprecated"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 23. HP/SGI Extensions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_data_structures_biblio.html">Prev</a> </td><th width="60%" align="center">Part III. 
12 Extensions
13
14 </th><td width="20%" align="right"> <a accesskey="n" href="bk01pt03ch23s02.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 23. HP/SGI Extensions"><div class="titlepage"><div><div><h2 class="title"><a name="manual.ext.containers"></a>Chapter 23. HP/SGI Extensions</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="ext_containers.html#manual.ext.containers.sgi">Backwards Compatibility</a></span></dt><dt><span class="section"><a href="bk01pt03ch23s02.html">Deprecated</a></span></dt></dl></div><div class="section" title="Backwards Compatibility"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="manual.ext.containers.sgi"></a>Backwards Compatibility</h2></div></div></div><p>A few extensions and nods to backwards-compatibility have
15 been made with containers. Those dealing with older SGI-style
16 allocators are dealt with elsewhere. The remaining ones all deal
17 with bits:
18 </p><p>The old pre-standard <code class="code">bit_vector</code> class is
19 present for backwards compatibility. It is simply a typedef for
20 the <code class="code">vector&lt;bool&gt;</code> specialization.
21 </p><p>The <code class="code">bitset</code> class has a number of extensions, described in the
22 rest of this item. First, we'll mention that this implementation of
23 <code class="code">bitset&lt;N&gt;</code> is specialized for cases where N number of
24 bits will fit into a single word of storage. If your choice of N is
25 within that range (&lt;=32 on i686-pc-linux-gnu, for example), then all
26 of the operations will be faster.
27 </p><p>There are
28 versions of single-bit test, set, reset, and flip member functions which
29 do no range-checking. If we call them member functions of an instantiation
30 of <code class="code">bitset&lt;N&gt;</code>, then their names and signatures are:
31 </p><pre class="programlisting">
32 bitset&lt;N&gt;&amp; _Unchecked_set (size_t pos);
33 bitset&lt;N&gt;&amp; _Unchecked_set (size_t pos, int val);
34 bitset&lt;N&gt;&amp; _Unchecked_reset (size_t pos);
35 bitset&lt;N&gt;&amp; _Unchecked_flip (size_t pos);
36 bool _Unchecked_test (size_t pos);
37 </pre><p>Note that these may in fact be removed in the future, although we have
38 no present plans to do so (and there doesn't seem to be any immediate
39 reason to).
40 </p><p>The member function <code class="code">operator[]</code> on a const bitset returns
41 a bool, and for a non-const bitset returns a <code class="code">reference</code> (a
42 nested type). No range-checking is done on the index argument, in keeping
43 with other containers' <code class="code">operator[]</code> requirements.
44 </p><p>Finally, two additional searching functions have been added. They return
45 the index of the first "on" bit, and the index of the first
46 "on" bit that is after <code class="code">prev</code>, respectively:
47 </p><pre class="programlisting">
48 size_t _Find_first() const;
49 size_t _Find_next (size_t prev) const;</pre><p>The same caveat given for the _Unchecked_* functions applies here also.
50 </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="policy_data_structures_biblio.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt03ch23s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Acknowledgments </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Deprecated</td></tr></table></div></body></html>