mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
Document ADT/PackedVector.h in "Programmer's Manual" doc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133077 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0f5b687075
commit
81df089f86
@ -64,6 +64,7 @@ option</a></li>
|
||||
<li><a href="#dss_deque"><deque></a></li>
|
||||
<li><a href="#dss_list"><list></a></li>
|
||||
<li><a href="#dss_ilist">llvm/ADT/ilist.h</a></li>
|
||||
<li><a href="#dss_packedvector">llvm/ADT/PackedVector.h</a></li>
|
||||
<li><a href="#dss_other">Other Sequential Container Options</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#ds_set">Set-Like Containers (std::set, SmallSet, SetVector, etc)</a>
|
||||
@ -1067,6 +1068,44 @@ Related classes of interest are explained in the following subsections:
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<h4>
|
||||
<a name="dss_packedvector">llvm/ADT/PackedVector.h</a>
|
||||
</h4>
|
||||
|
||||
<div>
|
||||
<p>
|
||||
Useful for storing a vector of values using only a few number of bits for each
|
||||
value. Apart from the standard operations of a vector-like container, it can
|
||||
also perform an 'or' set operation.
|
||||
</p>
|
||||
|
||||
<p>For example:</p>
|
||||
|
||||
<div class="doc_code">
|
||||
<pre>
|
||||
enum State {
|
||||
None = 0x0,
|
||||
FirstCondition = 0x1,
|
||||
SecondCondition = 0x2,
|
||||
Both = 0x3
|
||||
};
|
||||
|
||||
State get() {
|
||||
PackedVector<State, 2> Vec1;
|
||||
Vec1.push_back(FirstCondition);
|
||||
|
||||
PackedVector<State, 2> Vec2;
|
||||
Vec2.push_back(SecondCondition);
|
||||
|
||||
Vec1 |= Vec2;
|
||||
return Vec1[0]; // returns 'Both'.
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- _______________________________________________________________________ -->
|
||||
<h4>
|
||||
<a name="dss_ilist_traits">ilist_traits</a>
|
||||
|
Loading…
Reference in New Issue
Block a user