От: | Аноним | ||
Дата: | 30.08.06 07:27 | ||
Оценка: |
std::vector<char> cont;
std::vector<char>::iterator it = cont.begin();
while ((it = std::search(it, cont.end(), from.begin(), from.end())) != cont.end())
{
it = cont.erase(it, it + from.size());
size_t ind = it - cont.begin() + to.size();
cont.insert(it, to.begin(), to.end());
it = cont.begin() + ind;
}