Why can't for_each modify its functor argument?

后端 未结 3 1847
猫巷女王i
猫巷女王i 2020-12-31 18:00

http://www.cplusplus.com/reference/algorithm/for_each/
Unary function taking an element in the range as argument. This can either be a pointer to a

3条回答
  •  感情败类
    2020-12-31 18:26

    The semantics of For_each dont fit into what you are trying to do. accumulate does exactly what you are trying, use that instead.

提交回复
热议问题