1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Tell "the rest of the story" about LLVM's iterators' implicit conversions.

llvm-svn: 99642
This commit is contained in:
Dan Gohman 2010-03-26 19:39:05 +00:00
parent ab4f7619d9
commit 746a971656

View File

@ -1843,6 +1843,21 @@ void printNextInstruction(Instruction* inst) {
</pre>
</div>
<p>Unfortunately, these implicit conversions come at a cost; they prevent
these iterators from conforming to standard iterator conventions, and thus
from being usable with standard algorithms and containers. For example, it
prevents the following code, where <tt>B</tt> is a <tt>BasicBlock</tt>,
from compiling:</p>
<div class="doc_code">
<pre>
llvm::SmallVector&lt;llvm::Instruction *, 16&gt;(B-&gt;begin(), B-&gt;end());
</pre>
</div>
<p>Because of this, these implicit conversions may be removed some day,
and <tt>operator*</tt> changed to return a pointer instead of a reference.
</div>
<!--_______________________________________________________________________-->