函数原型:

```
template <class ForwardIterator, class T>
  void replace (ForwardIterator first, ForwardIterator last,
                const T& old_value, const T& new_value)
{
  while (first!=last) {
    if (*first == old_value) *first=new_value;
    ++first;
      }
}
```

功能： 把序列中等于old_value元素替换为 new_value；

示例：

```
int a[] = {1,4,6,5,5,3,7};
	vector<int> v(a,a+7);
	replace(v.begin(),v.end(),5,55);//把5替换成55 
```