的for_each [英] for_each

查看:76
本文介绍了的for_each的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将for_each描述为修改算法是错误的吗?这里描述的是:

http:/ /www.josuttis.com/libbook/algolist.pdf

转换似乎是用于修改

范围内元素的算法。 />

Fraser。


发布通过Usenet.com高级Usenet新闻组服务

--------- -------------------------------------------------

**速度**保留**完成**匿名**

--------------------- -------------------------------------
http://www.usenet.com

Is it wrong to describe for_each as a modifying algorithm? It is
described as one here: http://www.josuttis.com/libbook/algolist.pdf.
transform appears to be the algorithm to use for modifying elements in a
range.

Fraser.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

推荐答案

弗雷泽罗斯 < fraserATmembers.v21.co.ukwrote:
"Fraser Ross" <fraserATmembers.v21.co.ukwrote:

将for_each描述为修改算法是错误的吗?这里描述的是:

http:/ /www.josuttis.com/libbook/algolist.pdf

transform似乎是用于修改

范围内元素的算法。
Is it wrong to describe for_each as a modifying algorithm? It is
described as one here: http://www.josuttis.com/libbook/algolist.pdf.
transform appears to be the algorithm to use for modifying elements in a
range.



for_each是一种非修改算法,没有明确修改容器的

内容。传入for_each的仿函数可能,但是算法没有.b
算法没有。具体来说,算法中没有赋值操作




-

有两件事情根本无法怀疑。逻辑和我们的b $ b能够感知我们周围的世界。怀疑那些,你不再是b $ b有任何人讨论它,也没有讨论它的能力。

for_each is a non-modifying algorithm does not explicitly modify the
contents of the container. The functor passed into for_each might, but
the algorithm doesn''t. Specifically, there is no assignment operation
inside the algorithm.

--
There are two things that simply cannot be doubted. Logic and our
ability to sense the world around us. Doubt those, and you no longer
have anyone to discuss it with, nor any ability to discuss it.




Daniel T.

"Daniel T."

for_each是一种非修改算法,不会明确修改容器的

内容。传入for_each的仿函数可能,但是算法没有.b
算法没有。
for_each is a non-modifying algorithm does not explicitly modify the
contents of the container. The functor passed into for_each might, but
the algorithm doesn''t.



我认为目的是虽然算法并没有阻止

的修改,但无论如何,算子都不会修改

元素。


Fraser。


发布通过Usenet.com Premium Usenet新闻组服务

------------------------------------------------ ----------

**速度**保留**完成**匿名**

---------- ------------------------------------------------ <无线电通信/> http://www.usenet.com

< br>

文章< 11 ************** @ sp6iad.superfeed.net>,Fraser Ross

< fraserATmembers。 v21.co.uksays ...
In article <11**************@sp6iad.superfeed.net>, "Fraser Ross"
<fraserATmembers.v21.co.uksays...

将for_each描述为修改算法是不对的?这里描述的是:

http:/ /www.josuttis.com/libbook/algolist.pdf

transform似乎是用于修改

范围内元素的算法。
Is it wrong to describe for_each as a modifying algorithm? It is
described as one here: http://www.josuttis.com/libbook/algolist.pdf.
transform appears to be the algorithm to use for modifying elements in a
range.



C ++标准将for_each的描述放在Non-

修改序列操作中。 OTOH,其描述中没有任何内容可以阻止它修改序列中的项目。


-

后来,

杰瑞。


宇宙是自己想象的虚构。

The C++ standard places the description of for_each in the "Non-
modifying Sequence Operations." OTOH, there''s nothing in its description
that precludes it from modifying the items in the sequence either.

--
Later,
Jerry.

The universe is a figment of its own imagination.


这篇关于的for_each的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆