<tfoot id='Qt78x'></tfoot>
<legend id='Qt78x'><style id='Qt78x'><dir id='Qt78x'><q id='Qt78x'></q></dir></style></legend>

      <small id='Qt78x'></small><noframes id='Qt78x'>

        <bdo id='Qt78x'></bdo><ul id='Qt78x'></ul>
      <i id='Qt78x'><tr id='Qt78x'><dt id='Qt78x'><q id='Qt78x'><span id='Qt78x'><b id='Qt78x'><form id='Qt78x'><ins id='Qt78x'></ins><ul id='Qt78x'></ul><sub id='Qt78x'></sub></form><legend id='Qt78x'></legend><bdo id='Qt78x'><pre id='Qt78x'><center id='Qt78x'></center></pre></bdo></b><th id='Qt78x'></th></span></q></dt></tr></i><div id='Qt78x'><tfoot id='Qt78x'></tfoot><dl id='Qt78x'><fieldset id='Qt78x'></fieldset></dl></div>
      1. 迭代器的类型:输出 vs. 输入 vs. 前向 vs. 随机访问迭代器

        时间:2024-05-12
          <bdo id='i1AXk'></bdo><ul id='i1AXk'></ul>

              <small id='i1AXk'></small><noframes id='i1AXk'>

                <tbody id='i1AXk'></tbody>

                • <legend id='i1AXk'><style id='i1AXk'><dir id='i1AXk'><q id='i1AXk'></q></dir></style></legend>
                • <tfoot id='i1AXk'></tfoot>
                  <i id='i1AXk'><tr id='i1AXk'><dt id='i1AXk'><q id='i1AXk'><span id='i1AXk'><b id='i1AXk'><form id='i1AXk'><ins id='i1AXk'></ins><ul id='i1AXk'></ul><sub id='i1AXk'></sub></form><legend id='i1AXk'></legend><bdo id='i1AXk'><pre id='i1AXk'><center id='i1AXk'></center></pre></bdo></b><th id='i1AXk'></th></span></q></dt></tr></i><div id='i1AXk'><tfoot id='i1AXk'></tfoot><dl id='i1AXk'><fieldset id='i1AXk'></fieldset></dl></div>
                  本文介绍了迭代器的类型:输出 vs. 输入 vs. 前向 vs. 随机访问迭代器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  C++ STL 有多少种迭代器?到目前为止,我知道这些:

                  How many types of iterators are there in C++ STL? As of now, I know of these:

                  • 输出迭代器
                  • 输入迭代器
                  • 前向迭代器
                  • 随机访问迭代器

                  还有吗?它们之间有什么区别?各自的局限性和特点是什么?什么时候使用哪种类型?

                  Are there more? What are the differences between them? What are the limitations and characteristics of each? Which type is used when?

                  推荐答案

                  如果可以,请查找并阅读C++ 标准库:教程和参考".本书包含一整章关于 STL 迭代器的内容.

                  If you can, find and read "The C++ Standard Library: A Tutorial and Reference". This book contains a whole chapter about STL iterators.

                  这是书中的一些内容:

                  Iterator Category  Ability                          Providers
                  -----------------  -------------------------------  ----------------------------
                  Input iterator     Reads forward                    istream
                  Output iterator    Writes forward                   ostream, inserter
                  Forward iterator   Reads/writes forward             forward_list,
                                                                        unordered_[multi]set,
                                                                        unordered_[multi]map
                  Bidirectional it.  Reads/writes forward/backward    list, [multi]set, [multi]map
                  Random access it.  Reads/writes with random access  vector, deque string, array 
                  

                  这篇关于迭代器的类型:输出 vs. 输入 vs. 前向 vs. 随机访问迭代器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:是否有 STL 的可读实现? 下一篇:指针作为映射 C++ STL 中的键

                  相关文章

                • <tfoot id='EAJ2R'></tfoot>

                    <bdo id='EAJ2R'></bdo><ul id='EAJ2R'></ul>

                • <legend id='EAJ2R'><style id='EAJ2R'><dir id='EAJ2R'><q id='EAJ2R'></q></dir></style></legend>
                  <i id='EAJ2R'><tr id='EAJ2R'><dt id='EAJ2R'><q id='EAJ2R'><span id='EAJ2R'><b id='EAJ2R'><form id='EAJ2R'><ins id='EAJ2R'></ins><ul id='EAJ2R'></ul><sub id='EAJ2R'></sub></form><legend id='EAJ2R'></legend><bdo id='EAJ2R'><pre id='EAJ2R'><center id='EAJ2R'></center></pre></bdo></b><th id='EAJ2R'></th></span></q></dt></tr></i><div id='EAJ2R'><tfoot id='EAJ2R'></tfoot><dl id='EAJ2R'><fieldset id='EAJ2R'></fieldset></dl></div>

                    <small id='EAJ2R'></small><noframes id='EAJ2R'>