对于algorithm里面的函数使用不算多,但是用过之后才发现,之前写过很多多余的代码,所以打算系统的学习使用下algorithm里的东西,首先就是for_each. 先看下for_each的定义: template <class _InputIterator, class _Function> inline _LIBCPP_INLINE_VISIBILITY _Function for_each(_InputIterator __first, _InputIterator __last, _…