<i id='EhaT4'><tr id='EhaT4'><dt id='EhaT4'><q id='EhaT4'><span id='EhaT4'><b id='EhaT4'><form id='EhaT4'><ins id='EhaT4'></ins><ul id='EhaT4'></ul><sub id='EhaT4'></sub></form><legend id='EhaT4'></legend><bdo id='EhaT4'><pre id='EhaT4'><center id='EhaT4'></center></pre></bdo></b><th id='EhaT4'></th></span></q></dt></tr></i><div id='EhaT4'><tfoot id='EhaT4'></tfoot><dl id='EhaT4'><fieldset id='EhaT4'></fieldset></dl></div>
    1. <small id='EhaT4'></small><noframes id='EhaT4'>

        <legend id='EhaT4'><style id='EhaT4'><dir id='EhaT4'><q id='EhaT4'></q></dir></style></legend><tfoot id='EhaT4'></tfoot>
        • <bdo id='EhaT4'></bdo><ul id='EhaT4'></ul>
      1. STL 迭代器上下文中的奇异值和非奇异值是什么?

        时间:2024-08-14
          <bdo id='t7A3D'></bdo><ul id='t7A3D'></ul>
            <tbody id='t7A3D'></tbody>

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

            1. <tfoot id='t7A3D'></tfoot>

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

                  <legend id='t7A3D'><style id='t7A3D'><dir id='t7A3D'><q id='t7A3D'></q></dir></style></legend>
                  本文介绍了STL 迭代器上下文中的奇异值和非奇异值是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  C++ 标准 (2003) 中的第 24.1/5 节写道,

                  The section §24.1/5 from the C++ Standard (2003) reads,

                  就像一个普通的指向数组的指针一样保证有一个指针指向最后一个元素的值的数组,所以对于任何迭代器类型有一个迭代器值指向经过 a 的最后一个元素对应的容器.这些值被称为过终值.价值观迭代器 i 的表达式 *i 被定义被调用可解引用.图书馆从不假设最后的值是可解引用.迭代器也可以具有不属于的奇异值与任何容器相关联.[示例:在声明一个未初始化的指针 x(与 int*x;),必须始终假设 x 具有指针的奇异值.]大多数表达式的结果是对于奇异值未定义;这唯一的例外是赋值迭代器的非奇异值持有一个奇异值.在这种情况下奇异值被覆盖与任何其他值相同的方式.可取消引用的值总是非奇异.

                  Just as a regular pointer to an array guarantees that there is a pointer value pointing past the last element of the array, so for any iterator type there is an iterator value that points past the last element of a corresponding container. These values are called past-the-end values. Values of an iterator i for which the expression *i is defined are called dereferenceable. The library never assumes that past-the-end values are dereferenceable. Iterators can also have singular values that are not associated with any container. [Example: After the declaration of an uninitialized pointer x (as with int* x;), x must always be assumed to have a singular value of a pointer.] Results of most expressions are undefined for singular values; the only exception is an assignment of a non-singular value to an iterator that holds a singular value. In this case the singular value is overwritten the same way as any other value. Dereferenceable values are always nonsingular.

                  我真的无法理解以粗体显示的文字?

                  I couldn't really understand the text shown in bold?

                  • 什么是奇异值和非奇异值?它们是如何定义的?在哪里?
                  • 如何以及为什么可解引用值总是非奇异的?
                  • What is singular value and nonsingular value? How are they defined? And where?
                  • How and why dereferenceable values are always nonsingular?

                  推荐答案

                  迭代器也可以具有不与任何容器相关联的奇异值.

                  我想这就是它的定义.

                  可解引用的值如何以及为什么总是非奇异的?

                  How and why dereferenceable values are always nonsingular?

                  因为如果他们不这样做,取消引用他们将是未定义的行为.

                  Because if they wouldn't, dereferencing them would be undefined behavior.

                  这篇关于STL 迭代器上下文中的奇异值和非奇异值是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:我应该在哪里定义操作符 &gt;&gt;对于我对 std::pair 的专业化? 下一篇:你什么时候在 C++ 中使用函数对象?

                  相关文章

                      <bdo id='5XMN6'></bdo><ul id='5XMN6'></ul>
                  1. <i id='5XMN6'><tr id='5XMN6'><dt id='5XMN6'><q id='5XMN6'><span id='5XMN6'><b id='5XMN6'><form id='5XMN6'><ins id='5XMN6'></ins><ul id='5XMN6'></ul><sub id='5XMN6'></sub></form><legend id='5XMN6'></legend><bdo id='5XMN6'><pre id='5XMN6'><center id='5XMN6'></center></pre></bdo></b><th id='5XMN6'></th></span></q></dt></tr></i><div id='5XMN6'><tfoot id='5XMN6'></tfoot><dl id='5XMN6'><fieldset id='5XMN6'></fieldset></dl></div>

                    1. <small id='5XMN6'></small><noframes id='5XMN6'>

                      <tfoot id='5XMN6'></tfoot>
                      <legend id='5XMN6'><style id='5XMN6'><dir id='5XMN6'><q id='5XMN6'></q></dir></style></legend>