aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-03-26 19:39:05 +0000
committerDan Gohman <gohman@apple.com>2010-03-26 19:39:05 +0000
commit525bf8ee8ed372684e06ee395389e37828cc7cf3 (patch)
tree19fc2bd2a085443807776593febe2a3a978025ba /docs
parent394fdfbda8433c0d654d4d50392562362ada127e (diff)
downloadexternal_llvm-525bf8ee8ed372684e06ee395389e37828cc7cf3.zip
external_llvm-525bf8ee8ed372684e06ee395389e37828cc7cf3.tar.gz
external_llvm-525bf8ee8ed372684e06ee395389e37828cc7cf3.tar.bz2
Tell "the rest of the story" about LLVM's iterators' implicit conversions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99642 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/ProgrammersManual.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html
index a2d32d4..d1865f1 100644
--- a/docs/ProgrammersManual.html
+++ b/docs/ProgrammersManual.html
@@ -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>
<!--_______________________________________________________________________-->