加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c – 在STL迭代器的上下文中,什么是单数和非奇异值?

发布时间:2020-12-16 05:38:31 所属栏目:百科 来源:网络整理
导读:“C标准”(2003年)第24.1 / 5节, 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
“C标准”(2003年)第24.1 / 5节,

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.

我真的不明白粗体显示的文字吗?

>什么是奇异值和非奇异值?他们如何定义?在哪里?
>如何以及为什么无法理解的价值观永远是非奇异的?

解决方法

Iterators can also have singular values that are not associated with any container.

我想这是它的定义.

How and why dereferenceable values are always nonsingular?

因为如果不这样做,那么取消引用它们就是未定义的行为.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读